Skip to content

Add Claude Code delegation to Maple Agent - #976

Merged
AnthonyRonning merged 3 commits into
MaplePrivacyLabs:masterfrom
benthecarman:claude-code-support
Sep 22, 2026
Merged

AnthonyRonning merged 3 commits into
MaplePrivacyLabs:masterfrom
benthecarman:claude-code-support

Conversation

@benthecarman

@benthecarman benthecarman commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

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 --json to 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's multiSelect questions 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:

  • The component's full just ci recipe 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 pinned nix develop run.
  • Native Rust CLI fixtures cover streaming, confirmed-session resumption and failed-start recovery, provider isolation, approvals, multiple-choice answers, cancellation, malformed output, process cleanup, and authentication probe failures/timeouts. The cancellation fixture re-executes itself as a sleeping child and needs no host sleep executable.
  • Settings gates and session tool refresh tested with warm and cold runtimes and ACP exclusion.
  • The native question-card fixture passed interactive Linux checks in light/dark themes: multiple selection and deselection, numbered shortcuts, notes, advancing to a single-choice question, and Vim cursor movement/Enter toggling. Runtime broker tests cover answer delivery; the visual fixture runs without authentication or inference.
  • Earlier Linux debug-app checks verified the Claude logo, live sign-in status in light/dark themes, and the Settings toggle. Authenticated composer interaction was not exercised in the isolated offline UI profile.
  • An earlier non-Nix Linux release build passed, and the user tested the uploaded delegation build.

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 ci recipe passed again (844 tests). Hosted Linux/macOS confirmation is pending on this revision.

@AnthonyRonning AnthonyRonning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AnthonyRonning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@AnthonyRonning AnthonyRonning left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@AnthonyRonning
AnthonyRonning merged commit 5171566 into MaplePrivacyLabs:master Sep 22, 2026
22 checks passed
@benthecarman
benthecarman deleted the claude-code-support branch September 22, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants