Add Claude Code delegation to Maple Agent - #976
Conversation
abe8113 to
5b259ee
Compare
AnthonyRonning
left a comment
There was a problem hiding this comment.
Two non-blocking findings from a local review against claude 2.1.258 (stream-json protocol, interrupt, resume, and AskUserQuestion all verified outside the GUI). Details inline.
AnthonyRonning
left a comment
There was a problem hiding this comment.
The two fixups resolve both earlier comments (session confirmation before --resume, and multiSelect through to the card), thanks. Requesting changes only because the new claude_native_retries_only_resume_confirmed_sessions test fails deterministically on macOS and Ubuntu CI (Windows passes because the fixture tests are Unix-only), and I reproduced it locally on macOS 4/4 runs. It is a fixture log race, not a runtime bug; details inline.
Let Maple tasks delegate to an installed Claude Code CLI through a Rust transport adapted from Goose. Share Codex's activity, approval, question, and cancellation controls while keeping process ownership in Maple. Cover streaming, resumption, provider isolation, permissions, failures, and process cleanup with native CLI fixtures.
Show Codex and Claude in the composer only when enabled in Settings. Require each task to opt in, and block saved selections while Settings is disabled. Preserve task choices across restarts and re-enablement. Exercise admission, composer visibility, and cached tool refresh for both providers, including rejection of direct requests when disabled.
Explain Claude CLI setup, native transport provenance, and the separate Settings and task controls. Record the fixture validation workflow so future provider changes preserve the shared lifecycle contract.
9412afa to
7a9b23c
Compare
AnthonyRonning
left a comment
There was a problem hiding this comment.
Fixture fix confirmed: claude_native_retries_only_resume_confirmed_sessions and the other six claude_native_*/detection tests pass locally on macOS at 7a9b23c (previously failed 4/4 runs). Single-write log records are the right fix and the stricter parser will catch any regression. Earlier comments on session confirmation and multiSelect are resolved. Approving; CI on this head still needs a workflow approval click.
Adds Claude Code delegation alongside Codex in Maple Agent. Tasks can stream activity, answer approval and question cards, resume delegated sessions, and stop their child processes. The native Rust transport is adapted from the pinned Goose provider and requires only the installed Claude CLI.
The Claude card uses its logo and checks
claude auth status --jsonto show signed-in, signed-out, or unknown status. Status probes are bounded and account details are not retained. Failed launches before session confirmation retry with a fresh session instead of trying to resume an unsaved UUID. Claude'smultiSelectquestions support multiple choices and optional notes in Maple's question card.For both providers, Settings controls availability in the composer. Each task must explicitly select a provider; disabling it in Settings hides it and blocks saved selections on the next run. Task choices persist across restarts.
Validation:
just cirecipe passed on NixOS using installed host tools: formatting, four Clippy configurations, warning-denied workspace builds, 809 workspace tests, and 35 headless tests. This was not a pinnednix developrun.sleepexecutable.Native GUI checks ran on Linux only.
The fixture log race reported in review is fixed: complete JSON records and their newlines are appended together, and the resumption test rejects malformed records directly. The affected test passed 100 consecutive local runs; the full
just cirecipe passed again (844 tests). Hosted Linux/macOS confirmation is pending on this revision.