Skip to content

refactor(task): centralize execution context - #11528

Merged
jdx merged 1 commit into
agent/refactor-task-scheduler-contextfrom
agent/refactor-task-execution-context
Jul 30, 2026
Merged

jdx merged 1 commit into
agent/refactor-task-scheduler-contextfrom
agent/refactor-task-execution-context

Conversation

@jdx

@jdx jdx commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

Stack created with GitHub Stacks CLI • Give Feedback 💬


Note

Low Risk
Mechanical signature refactor in the task executor with no intended logic changes; risk is limited to accidental parameter wiring mistakes during review.

Overview
Refactors task execution plumbing in task_executor.rs by grouping long parameter lists into three internal context structs, without changing runtime behavior.

TaskExecContext bundles task, env, output prefix, optional artifact output capture, and interruption policy. It is built once in run_task_sched and passed through exec_file → exec → exec_program, plus exec_script and the ETXTBUSY retry path, replacing repeated per-method argument lists.

TaskRunEntriesContext carries config, the shared exec context, task env, scheduler channel, runtime lock guard, completion state, and semaphore/permit for exec_task_run_entries.

TaskInjectionContext groups config, env, scheduler, completion state, and interruption flag for inject_and_wait when run entries invoke nested tasks or task groups.

Several #[allow(clippy::too_many_arguments)] attributes are removed as a result.

Reviewed by Cursor Bugbot for commit b1613b8. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a99dee99-b0b8-4ada-9395-7a2b6c92d06b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Centralizes task execution parameters into dedicated context structs.

  • Adds contexts for general execution, run-entry scheduling, and nested task injection.
  • Replaces long helper argument lists while preserving the existing execution data flow.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/task/task_executor.rs Groups existing task execution parameters into context structs with one-to-one field wiring and no identified behavioral change.

Reviews (2): Last reviewed commit: "refactor(task): centralize execution con..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▂▂▁▆▆█▆██▇▇█▇▇█▆▃▅ 84,685,231 → 84,828,944 +0.17% 31.26 → 20.53ms -34.33%
hook-env ▄▃▃▇▇█▆███▇▇█▇▇▇▁▁ 87,057,131 → 87,072,285 +0.02% 26.40 → 19.74ms -25.24%
ls ▄▆▁▄▅█▃▅▅▇▅▆▆▆▆▄▅▄ 76,709,887 → 76,684,306 -0.03% 21.20 → 17.82ms -15.91%
registry ▇▅▃▇▇█▅█▇██▇█▆▆▅▁▅ 50,102,060 → 50,182,832 +0.16% 14.46 → 12.30ms -14.95%
startup ▇█▃▇▇▇▆▇▆▇▇▇▇▅▆▅▁▁ 15,941,779 → 15,937,460 -0.03% 11.62 → 9.00ms -22.54%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

b1613b8a6ef2 vs 1581ac06d458 · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/refactor-task-execution-context branch from 5baf366 to b1613b8 Compare July 30, 2026 23:20
@jdx
jdx merged commit 4c6b40d into main Jul 30, 2026
37 of 55 checks passed
@jdx
jdx deleted the agent/refactor-task-execution-context branch July 30, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant