Repository navigation
Seed Scratch Manager briefs from the .md file only; never paste them (CROW-1327) - #1328
Merged
Merged
Conversation
…(CROW-1327) Opening a Manager from a Scratch item launched the agent with the brief file as argv, then also pasted the full multi-line brief, retried Enter, and re-pasted it. On a slow SessionStart that second copy landed offset, so the agent got the raw scratch text without the instruction preamble. - Fresh Manager: the launch command is the only delivery; no paste. - Live Manager (re-Explore, Ticket on an alive Manager): rewrite the brief file and type one line, "Read and follow the instructions in <path>". - sendToManager types one line and retries a bare Enter at most once; the full re-paste and dead accepted-prompt polling are removed. - TodoRPC.writeBriefFile / briefPointer / briefDelivery with tests for both paths across Claude Code, Cursor, Codex, Grok and OpenCode. 🐦⬛ Generated with Claude Code, orchestrated by Crow Co-Authored-By: Claude <noreply@anthropic.com> Crow-Session: A0C5CB89-F00F-4D80-A8DA-23D095CAAB0C
dhilgaertner
approved these changes
Oct 13, 2026
dhilgaertner
left a comment
Contributor
There was a problem hiding this comment.
Code & Security Review
Critical Issues (if any)
None.
Architecture / Existing Patterns
- Existing pathway: CROW-1237 argv seed —
ManagerSessionController.exploreSeedLaunchCommandwrites$TMPDIR/crow-explore-<session>.mdand wraps the Manager launch withShellLaunchArgs.evalPromptLaunch(same shape as jobs / #408).sendToManagerinTodoRPCHandlers.swiftwas the leftover paste fallback after that seed. - This change extends that path instead of replacing it. Fresh Managers stay argv-only; live Managers get a one-line pointer through the existing typer. Dropping
promptWasAcceptedandagentAnnouncePollsis the right cut: those existed to guess whether the argv seed had started so a second copy of the brief could be skipped or re-pasted. - Green: #1327 asked for a pointer fallback on a fresh Manager if a harness ignores positional argv. This PR does not add that arm — it matches the job launch (argv or nothing). The description already marks repeated cold launches across the five harnesses as unverified.
Security Review
Strengths:
- The brief path is
NSTemporaryDirectory()plus a session UUID (TodoRPCSupport.swiftexplorePromptPath), not derived from scratch text, so the pointer line cannot be steered at an attacker-chosen file. writeBriefFilerefuses whitespace-only bodies and writes atomically. Live Managers never put the multi-line brief (backticks,gh issue create,crow todo link) into a TUI that might still be zsh.sendToManagerno longer re-sends the payload. A second full paste was the offset/truncation failure this ticket exists to stop.
Concerns:
- None that are defects in this diff.
managerTerminalstill takesappState.terminals[sessionID]?.firstrather thanisAgentSurface; that is pre-existing on the talk path. A one-line pointer landing in a still-starting shell is safer than the old 20-line brief.
Code Quality
- Green:
freshManagerSeedsViaArgvWithNoFollowUpPasteinTodoRPCSupportTests.swiftchecksexploreSeedLaunchCommandandbriefDelivery == .launchArgv. It does not runopenScratchManager, which is the site that used to callsendToManager(..., text: brief). The handler change is the actual "no follow-up paste" guarantee. swift test --package-path Packages/CrowEngine --filter TodoRPCSupportTests— 21/21 passed.swift build --package-path Packages/CrowDaemon— clean.
Summary Table
| Color | Meaning | Verdict effect |
|---|---|---|
| Red | Must fix | Request changes |
| Yellow | Should fix | Request changes |
| Green | Consider | Approve allowed |
Recommendation: Approve — driven by 0 Red, 0 Yellow, 2 Green 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.
Closes #1327
Problem
todo explore/todo ticketwrote the brief to$TMPDIR/crow-explore-<session>.mdand launched the Manager with it as argv (CROW-1237) — then also pasted the full multi-line brief viasendToManager, retried Enter, and re-pasted it when the agent looked idle. On a slowSessionStartthat second copy landed offset (2026-10-13 repro: the Manager's prompt began atScratch item, preamble gone).Change
The
.mdfile is the single source of truth for the seed.seeded= brief file written && pane appeared.Read and follow the instructions in <path>.sendToManager(pointer line +todo talkonly) types one line and retries a bare Enter at most once. The full re-paste and the accepted-prompt polling (promptWasAccepted,agentAnnouncePolls) are removed — the latter were only there to guess whether the argv seed had started.TodoRPC.writeBriefFile/briefPointer/briefDelivery;exploreSeedLaunchCommanduseswriteBriefFile.seeded: falsenow say what actually failed instead of "still starting".CLAUDE.md,docs/cli-reference.md, ADR 0026 wording, CHANGELOG.Tests
freshManagerSeedsViaArgvWithNoFollowUpPaste— for Claude Code, Cursor, Codex, Grok, OpenCode: the file holds the complete brief (first line intact), the launch command reads it, delivery is.launchArgv(no paste).aliveManagerGetsOnlyThePointerLine— delivery is a single-line pointer, never brief text.unwrittenBriefDeliversNothing.swift test --package-path Packages/CrowEngine --filter TodoRPCSupportTests— 21/21 pass.swift build --package-path Packages/CrowDaemonclean (CrowDaemon tests not run on host — they bootcrowd).Not verified
Repeated cold launches across all five harnesses in a live Crow (the ticket's manual acceptance check) — please run
crow todo ticket/todo explorea few times per harness after merge.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.