fix(conpty): stop pinning --effort on hand-driven interactive sessions

Task, ad-hoc, planning, handoff and resume sessions now inherit the CLI
default / the user's /effort setting. List-handler sessions keep their
per-role effort.
This commit is contained in:
mika kuns
2026-10-02 12:09:19 +02:00
parent 309bdcc903
commit d9f42d7d48
4 changed files with 37 additions and 71 deletions
+9 -8
View File
@@ -15,9 +15,9 @@ Autonomous queue tasks are **not** covered here — they stay on the stream-json
| Kind | Hub spec method | Notes |
|---|---|---|
| Task session | `GetInteractiveLaunchSpec` | Effort from the task/list model preset |
| Ad-hoc | `GetAdHocLaunchSpec` | Effort from the global default |
| Planning | (planning start/resume) | Effort from `PlanningAlias`; uses `--permission-mode default`, **not** `plan` |
| Task session | `GetInteractiveLaunchSpec` | No `--effort` — CLI default |
| Ad-hoc | `GetAdHocLaunchSpec` | No `--effort` — CLI default |
| Planning | (planning start/resume) | No `--effort`; uses `--permission-mode default`, **not** `plan` |
| List handler | `GetMergeHelperLaunchSpec` / `GetMergeHelperHandoffLaunchSpec` | Model + effort fixed per role (`ModelRegistry.HandlerTriageAlias`/`HandlerWaitAlias`/`HandlerMergeAlias`), **not** from list config; `--permission-mode` via `PermissionModeResolver` (unattended) |
## ⚠️ Gotcha: never pass task free-text as a CLI argument
@@ -39,9 +39,10 @@ description skips the file **and** the positional arg entirely — it still gets
## Argument ordering
Every spec passes `--effort <level>` from the relevant model's preset. It **leads** the args —
except for a fresh task session with a brief, where `--add-dir <sessionDir>` must come first so
`--effort` (a single-value flag) can sit directly before the positional kickoff.
Only the list-handler specs pass `--effort` (from the role model's preset). Hand-driven sessions
(task, ad-hoc, planning, handoff, resume) deliberately pass none, so the CLI default / the user's
`/effort` setting applies. A positional kickoff must follow a single-value flag (`--session-id`,
`--append-system-prompt-file`), never a variadic one (`--add-dir`, `--allowedTools`).
`--model` is deliberately **NOT** forced on an interactive session — the user can still switch
models in the TUI.
@@ -87,7 +88,7 @@ own transcript:
`TaskRepository.SetInteractiveSessionIdAsync` — **before** the `LaunchSpec` is returned, i.e.
before the ConPTY host ever spawns `claude`. `BuildFreshTaskArgsAsync` then passes it as
`--session-id <guid>`, placed as the single-value flag directly before the positional kickoff
(or, with no brief, right after `--effort`).
(or, with no brief, as the only arg).
3. **Fresh worktree wins.** `isFreshWorktree` forces `run` to `null` *and* is checked before
reading `task.InteractiveSessionId`, so a recreated worktree never resumes a stale id from
either source — it always takes the fresh path, which overwrites the stale
@@ -355,7 +356,7 @@ Autonomous and interactive sessions do **not** share a system prompt. Per start
|---|---|---|
| Autonomous run/continue/retry | `TaskRunner.ResolveConfigAsync` → `ClaudeArgsBuilder.Build` | `--append-system-prompt <text>`, recomputed and re-sent on **every** invocation including a `--resume` continue (`PromptKind.System` + improvement/list/task overrides) |
| Interactive task session, fresh | `InteractiveLaunchSpecService.BuildForTaskAsync` → `BuildFreshTaskArgsAsync` | none — no `--append-system-prompt(-file)` at all |
| Interactive task session, resume | `InteractiveLaunchSpecService.BuildForTaskAsync` → `WindowsTerminalLauncher.BuildResumeArgs` | none — only `--resume <id>` (+ `--effort`) |
| Interactive task session, resume | `InteractiveLaunchSpecService.BuildForTaskAsync` → `WindowsTerminalLauncher.BuildResumeArgs` | none — only `--resume <id>` |
| Ad-hoc directory session | `InteractiveLaunchSpecService.BuildForDirectoryAsync` | none |
| Planning session start | `InteractiveLaunchSpecService.BuildPlanningStart` → `WindowsTerminalLauncher.BuildPlanningStartArgs` | `--append-system-prompt-file <path>` (`PromptKind.Planning`) |
| Planning session resume | `InteractiveLaunchSpecService.BuildPlanningResume` → `WindowsTerminalLauncher.BuildPlanningResumeArgs` | none — only `--permission-mode default --allowedTools <planning allowlist> --resume <id>` |