Skip to content

feat(cli): add a --handoff command emitting a redacted handoff brief for a parallel agent's leased workspace (#236)#237

Merged
qwen-code-dev-bot merged 1 commit into
mainfrom
issue/236-result-handoff
Jul 23, 2026
Merged

feat(cli): add a --handoff command emitting a redacted handoff brief for a parallel agent's leased workspace (#236)#237
qwen-code-dev-bot merged 1 commit into
mainfrom
issue/236-result-handoff

Conversation

@qwen-code-dev-bot

Copy link
Copy Markdown
Owner

Summary

Adds an opt-in (--handoff) read-only command that emits a handoff brief for a parallel agent's leased workspace, decomposed from roadmap #39 (isolated parallel agents).

Operators could provision (#50), observe (#232), integrate (#228), and cancel (#230) parallel workspaces, but when a parallel agent finished there was no structured handoff describing what that specific agent accomplished — they had to inspect the lease branch by hand before deciding to integrate or cancel. The existing briefs (#70/#116) describe the current change, not a specific parallel agent's leased workspace.

Design

  • src/worktree-lease.ts: new collectWorktreeHandoff(opts) (reusing the module's lease-derivation/git helpers) plus formatWorktreeHandoff. For a specific lease (task+agent identity) it reports the branch, abbreviated head, the commits the agent made since the base (HEAD..branch), the changed paths (HEAD...branch, home-collapsed), and the clean/dirty state — bounded (50 commits / 100 paths) and redacted. Strictly read-only; an absent lease yields present:false (not an error).
  • src/index.ts: opt-in --handoff (with --task-identity/--agent-identity) wired as a read-only mode (JSON + text), exiting 0 on success and 2 on a missing identity or non-repository target.

Testing

  • tests/unit/result-handoff.test.ts (9 tests): absent handoff, branch/head/commits/changed-paths for a lease that committed, dirty state, secret-shaped commit-subject redaction, no-mutation proof, missing-identity and non-repository refusal, and formatting (absent + present).
  • tests/integration/result-handoff.test.ts (3 tests): CLI emits a handoff brief (JSON) for a lease that made a commit (read-only), an absent handoff (text) for an unknown lease, and exit 2 on a missing identity.

Gates: typecheck, build, unit (1667), integration (464 + desktop), smoke (51) all pass.

Closes #236

…for a parallel agent's leased workspace (#236)

Operators could provision, observe, integrate, and cancel parallel workspaces, but when a parallel agent finished there was no structured handoff describing what that specific agent accomplished — they had to inspect the lease branch by hand before deciding to integrate or cancel. Add collectWorktreeHandoff plus an opt-in --handoff command (by --task-identity/--agent-identity) that reports the lease branch, the commits the agent made since the base, the changed paths, and the clean/dirty state, bounded and redacted. Strictly read-only; an absent lease is an absent handoff, not an error.
@qwen-code-dev-bot

Copy link
Copy Markdown
Owner Author

E2E verification

  • Repository: qwen-code-dev-bot/oh-my-cli
  • Pull request: #237
  • Commit: 7bb83fbe388a7683758a504a7c20d1f06522aceb
  • Evidence mode: terminal
  • Result: PASS
Scenario Command Exit Duration
integration npm run test:integration 0 30.317s
smoke npm run smoke 0 3.269s

E2E evidence

Full immutable report

@qwen-code-dev-bot
qwen-code-dev-bot merged commit 61d3806 into main Jul 23, 2026
2 checks passed
@qwen-code-dev-bot
qwen-code-dev-bot deleted the issue/236-result-handoff branch July 23, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant