feat: reuse executor sessions within Codex tasks
This commit is contained in:
@@ -13,6 +13,7 @@ Support these explicit operations:
|
||||
|
||||
```text
|
||||
$agent-workflow-host 执行已确认计划
|
||||
$agent-workflow-host 执行新任务计划
|
||||
$agent-workflow-host 使用 claude 执行已确认计划
|
||||
$agent-workflow-host 使用 svn 执行已确认计划
|
||||
$agent-workflow-host 继续 <run-id>
|
||||
@@ -30,6 +31,9 @@ $agent-workflow-host 日志 <run-id> [--follow]
|
||||
- If invoked without an operation, show the supported operations and do nothing.
|
||||
- Default to `reasonix`. Use `claude` or `agy` only when the user explicitly selects it or the approved plan already names it.
|
||||
- Never switch or fall back to another executor during a run.
|
||||
- Treat the current task as the durable binding identified by `CODEX_THREAD_ID` plus the target repository. Each task may lazily bind one Reasonix, one Claude, and one Agy session; do not eagerly start unused executors.
|
||||
- A normal `执行` starts a new run in the current task and automatically reuses the selected executor's bound session when one exists. The other executor bindings remain untouched.
|
||||
- Use `执行新任务计划` and pass `--new-task` only when the user clearly starts a materially different task. If the boundary is ambiguous, ask whether the prior executor context should be retained.
|
||||
|
||||
## Host Boundaries
|
||||
|
||||
@@ -68,9 +72,11 @@ $agent-workflow-host 日志 <run-id> [--follow]
|
||||
7. Start the run and record the emitted run ID, then immediately print a logs-follow command the user can run independently:
|
||||
|
||||
```bash
|
||||
agent-workflow start --plan <temp-plan.json> --executor <reasonix|claude|agy> [--vcs <git|svn|none>]
|
||||
agent-workflow start --plan <temp-plan.json> --executor <reasonix|claude|agy> [--vcs <git|svn|none>] [--new-task]
|
||||
```
|
||||
|
||||
Do not pass `--new-task` for a follow-up plan, a correction, or another implementation slice of the same user goal. The CLI validates persisted task bindings before reuse and blocks stale or mismatched handles. An executor selected for the first time in the task starts lazily and is then recorded for later runs. Agy degraded `--continue` handles are intentionally not shared.
|
||||
|
||||
After starting, announce:
|
||||
```text
|
||||
Run <run-id> started. Monitor live output: agent-workflow logs --run <run-id> --follow
|
||||
@@ -164,6 +170,7 @@ After `fix`, repeat review and decision for the new cycle. Respect the configure
|
||||
## Failure Handling
|
||||
|
||||
- Missing session handle, executor failure, or baseline drift (Git HEAD change, SVN revision change) must stop as `blocked`; do not work around the gate. A missing Reasonix handle may use validated automatic recovery, and a missing Claude session may use the explicit validated session-rebind retry operation when a matching persisted session is known.
|
||||
- If task-level reuse is rejected because a persisted session is missing or belongs to another repository, do not fall back to a recent external session. Use `--new-task` only after confirming this is a new task; otherwise preserve the binding and report the recovery problem.
|
||||
- When a resume failed before producing cycle artifacts because the same session was busy, ask the user to close the owning executor process, then use `retry-execute`; never kill an unrelated process automatically.
|
||||
- Out-of-scope edits must enter `awaiting_scope_resolution`; inspect and remediate them through the same executor session. Repeated identical violations must stop as `needs_human`.
|
||||
- Same finding in consecutive reviews or disappear/reappear oscillation must stop as `needs_human` when the engine reports non-convergence.
|
||||
|
||||
Reference in New Issue
Block a user