One worker system: retire the Keychain product path + single-worker spawn model (remaining scope from PR #5632)
- Dominant language
- Rust
- Stars
- 41k
- Forks
- 3.6k
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 299
Description
## Combined Core execution: C07
[Core execution plan]() owns order and scope. This issue contributes to C07; the linked plan owns the complete packet and any outstanding candidate acceptance. Record this issue's path claims and implementation evidence here.
**Issue mapping:** [SHA-6315 / GitHub #5718]()
includes the one-worker/profile-inheritance migration. Credit the already
landed account-session Keychain prompt fix; reconcile every remaining item:
parent-profile/permission inheritance, non-git and read-only parallel workers
without forced worktrees, `/mcp connect github` add/login chaining, and
autosave `title_source` provenance. Coordinate credential-backend retirement
with C04's secrets owner and explicit migration disposition; do not silently
grant full permissions or delete a credential backend. The old PR is a
rebase-and-repair source, not a merge-ready implementation.
[SHA-6282 / GitHub #5575]() requires one derived
role/profile/dispatch description contract shared with C05, without
contradictory worker promises or elevated child permissions.
[SHA-6252 / GitHub #5529]() adds worker budget soft
landing, preserved workspace/checkpoint/report, exact-route credential dispatch
and truthful foreground/background shell results. Reconcile current source and
qualify those paths in C14; the older proposal grants no blanket authority to
commit work or switch providers on failure.
**Owner: execution owner. Dependencies: C04–C06.** Inventory and preserve
child budgets, route pins, permission/tool activation, steering, parking,
checkpoints, nesting and terminal fan-in. Adapt child work to the existing
engine execution implementation, then delete `run_subagent`'s duplicated
model-request/tool-result cycle. Agent/task tools call runtime capabilities;
they do not become a second runtime. Keep this behavioral convergence separate
from C08's mechanical move.
**Completion evidence required:** actual parent/child call paths share execution, with local
mock-provider turns, tool approval/denial, streaming, cancel/steer, nested work,
parking/resume and exact-once terminal fan-in passing. The existing guard that
counts functions named `run_turn` cannot prove this; prove the call path and
behavior. Preserve C01's worker ownership and history fix.
---
## Original issue and contributor history
Tracking the remaining scope of PR Hmbown/CodeWhale#5632 (being closed — see the receipt there). The urgent slice already landed as Hmbown/CodeWhale#5662 (account sessions stop popping Keychain). What remains, verified against current main:
1. **Full OS-keyring retirement**: main still carries the complete `KeyringStore`/`DefaultKeyringStore` backend in `crates/secrets/src/lib.rs`. The design: `CODEWHALE_SECRET_BACKEND=system|keyring` becomes a no-op, secrets live in `~/.codewhale/secrets/` mode 0600.
2. **Single-worker spawn model**: subagent spawns inherit the parent profile, roles become labels, the permission-preset matrix goes away (`tools/subagent/*`, `simple_worker.rs`, `worker_profile.rs`).
3. `/mcp connect github` **chaining** add+login.
4. Two Devin findings that must be addressed in any revival (from the PR review):
* BUG `tools/subagent/mod.rs:9387-9396`: parallel spawns forced into git worktrees (`should_isolate_worktree(false, parallel)`) — fails in non-git workspaces and isolates read-only fan-out needlessly.
* Root spawns getting full permissions in every mode (`allow_shell`, `permissions=full()`, `shell=Full` overriding the parent profile) — needs an explicit intent decision.
5. `title_source` provenance dropped on autosave (session_manager.rs, latent).
The conflict surface is large (17 files also touched on main since the merge-base), so this is a deliberate rebase-and-repair effort, not a merge. Closes the CLI side of cwc#154 when done.
Contributor guide
Research direction
Start with the linked C07 core execution plan, then inspect crates/secrets/src/lib.rs, tools/subagent/mod.rs, tools/subagent/*, simple_worker.rs, worker_profile.rs, and session_manager.rs. Trace the current parent/child call paths and run the listed local mock-provider, approval, streaming, cancel/steer, nesting, parking/resume, and terminal fan-in checks. Done means the remaining migrations and shared execution behavior are reconciled without violating the stated C04–C06 dependencies or C01 ownership fixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- backend, cli, security
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100