Repository navigation
feat: add per-worker Claude Code Mode trial - #20
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Trial on one Claude worker
That is the answer to this question: "Should I trial Claude Code's experimental Code Mode in the fleet?" The chosen option read: "I start the next suitable Claude worker with the setting on for that worker only and report: did it start, did anything get refused, did the work go faster. Nothing else changes, and the worker's session is thrown away at the end of its task as usual."
Code Mode is an experimental, off-by-default Claude Code feature (https://code.claude.com/docs/en/code-mode.md). It is switched on by the environment variable
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1in the shell or in user settings. A first attempt set the variable on thebin/fm-spawn.shcommand; the worker reported the variable unset, because a worker terminal takes its environment from the terminal daemon, not from the spawn command. The user settings file is not an option: it would switch the feature on for every session.What Changed
--code-modeopt-in for canonical Claude ship and scout launches, injecting the experimental environment setting without changing Claude user settings.Risk Assessment
✅ Low: The implementation is bounded to canonical single-worker Claude launches, preserves the opt-in only in task metadata for relaunch, and refuses batch dispatch before the worker-creation loop.
Testing
The focused spawn-profile suite passed, exercising emitted launch commands, metadata persistence, relaunch, allowlist behavior, and refusals. A disposable live lab confirmed the batch guard and produced a CLI transcript; this CLI-only change has no rendered UI surface, so no screenshot applies.
Evidence: Live batch-refusal transcript
Source: Live batch-refusal transcript
Evidence: Focused spawn-profile test transcript
Source: Focused spawn-profile test transcript
Trial activation and validation limits
Validation coverage: a live isolated invocation of
fm-spawn.shverified that any batch dispatch with--code-moderefuses before creating task state.The executable spawn-profile suite passed and executed emitted launch commands to cover single Claude ship/scout opt-in, recorded relaunch, environment allowlist filtering, and refusals for other harnesses, raw commands, secondmates, and T3 Code.
Those single-worker, relaunch, and unsupported-target scenarios were covered by the suite only; they were not driven against a real Claude worker in this validation run.
Firstmate will perform the live Claude proof after merge on the first real spawn with
--code-mode, including the required human confirmation; startup refusals and speed remain to be observed.Activation: pass
--code-modeon the selected Claude ship or scout spawn.That worker's launch assigns
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1.A person must answer Claude Code's one-time confirmation dialog before the trial can proceed.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
Step was skipped.
🔧 **Review** - 2 issues found → auto-fixed ✅
bin/fm-spawn.sh:2244---code-modeis forwarded to everyid=repobatch member. A two-pair Claude batch therefore starts two Code Mode workers, as the changed test intentionally verifies. This contradicts the required “Trial on one Claude worker” / “for that worker only” and “Nothing else changes” criteria. Remove batch forwarding or explicitly refuse Code Mode in batch mode; this is also the unrequired batch-expansion component.bin/fm-spawn.sh:2649- A relaunch accepts a new--code-modeeven when the existing task has nocode_mode=1record. For a prior Claudebackend=t3codetask,fm-spawn.sh ID --relaunch --code-modeskips the fresh-only T3 refusal, writescode_mode=1, but T3 ignores the pane$LAUNCH, so Code Mode is not enabled. Track whether the flag was supplied and reject it on relaunch; derive this setting solely from recorded task metadata.🔧 Fix applied.
✅ Re-checked - no issues remain.
tests/fm-spawn-dispatch-profile.test.sh(exit 0)FM_HOME=<disposable lab> TMUX_TMPDIR=<private lab socket> bin/fm-spawn.sh code-mode-live-a=<worktree> code-mode-live-b=<worktree> --harness claude --code-mode --mode no-mistakes --yolo off(exit 1, expected)git diff <base> | jev find "a change unrelated to experimental Claude Code Mode single-worker launch, recorded relaunch, guard refusals, or documentation"(no unrelated hunks flagged)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.