Repository navigation
fix(dev): pnpm dev trial agents sign in through a model provider, as eval's do - #1413
Conversation
|
Review (GPT 6.1 Sol), two rounds. Round 1, at 3903325.
Two sanitizer findings:
Round 2, at c55723b. Splitting on commas fixed finding 1, but caused two problems of its own:
Resolution.
The next push carries this, with tests for a comma-joined line and for output the sanitizer must leave alone. |
|
Review (GPT 6.1 Sol), rounds 3 and 4: the provider's address. The earlier acceptance verdict noted that Round 3 found four gaps in that commit, and 8d1157e fixes them:
Round 4, at 8d1157e: nothing blocking. All four were rerun and are fixed. Sol also checked default ports, bracketed IPv6, loopback spellings, encoded forms, and that ordinary output survives. |
Acceptance: PASS with notesChecked Done means
The earlier non-loopback and loopback runs: not rerun, since this diff can't change them. The diff touches one case only: a non-loopback host with no dot or bracket. Before, it got no host spellings. Now it gets the ones containing a colon.
The earlier runs used Golden journeys
Rollback answers: they match the diff. A revert leaves nothing behind: no migrations, Not run
Notes
|
…eval's do Co-Authored-By: Claude Opus 5.5 <[email protected]>
0200529 to
bb9ae7f
Compare
…ey shortcuts (#1421) ## What changed This adds release 42's What's new entry, written from `1cd6d12`. It covers everything merged since release 41's `through` (`a25a9c5`), and sets the `patchy` release to `0.42.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Tell Patchy what it's missing | #1217, #1218, #1219, #1227, #1228 | | New: Turn off single-key shortcuts | #1276, #1279, #1301 | | Fixed: Typing reaches the patch again | #1407, #1412 | | Fixed: Dialogs in patches keep your place | #1420, #1255 | | Behind the scenes: plainer facts for agents building patches | #1249, #1256, #1297, #1418 | | Behind the scenes: Patchy stores teams and audiences ahead of teams | #1416 | | Patch changes: Mod+/ and `client.close()` in patchy/hotkeys; single-key shortcuts can be off; Tab wraps in plain modal dialogs | #1279, #1301, #1420 | #1376 is release 41's own entry. #1400, #1406, #1414, #1415, #1302, #1413 and #1419 are test, CI and dev tooling and need no line. The teams bridge (#1416) ships alone in this release so teams (#1417) can follow in the next one with a release to roll back to that reads its data closed. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `7f93b91` (release 41) to this PR's merge.** No PR in the range is labelled `one-way`, and every Release impact answer says release 41 still works: - **#1217** adds migration `0037_feedback`, a schema release 41 never reads. **#1227** and **#1228** write into it. - **#1276** adds migration `0038_single_key_shortcuts`, a column with a default that release 41 never selects. - **#1416** adds migrations `0039_company_teams` to `0041_connection_audiences`, which hold tables that stay empty until teams ship, and widens one scope check. Its CI rehearsal ran `7f93b91 → head → 7f93b91 → head` on one set of data, and all four steps passed. - **#1279**, **#1301**, **#1255** and **#1420** change the SDK and the shell. Patches built on this release carry a `shortcutSetting` manifest field that release 41 reads without refusing, and its shell names no frame, so every shortcut stays on. - **#1218** and **#1219** add CLI commands and an optional `feedbackHint` in `--json` failures. A CLI from this release refuses to publish to an older instance before sending anything, as any mismatched release does. - Everything else is skill text, docs, tests and CI. If this release misbehaves, roll back to `7f93b91` (release 41). Written by Claude Opus 5.5 in Claude Code, through T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
pnpm dev trialstarted its agents with the runner's closed environment plus three sign-in variables, and theagentlauncher loads no user settings. So on a machine that reaches Claude through a model provider (ANTHROPIC_BASE_URLwithANTHROPIC_AUTH_TOKENorANTHROPIC_CUSTOM_HEADERS, set in the environment or in Claude Code'ssettings.json), a trial's agents couldn't sign in.pnpm dev evalalready handled this case.Now a trial's agents get the provider the same way eval's builders do, through one shared module.
Closes #1300
Look at
scripts/dev/src/claudeSignIn.tsholds whateval/home.tshad inline.readClaudeVariablesreads each variable from the environment, thendev.env, then theenvof Claude Code'ssettings.json.providerEnvpasses the provider only whenANTHROPIC_BASE_URLnames one, and eval'sclaudeEnvis built on it. Eval's sandbox setup stays where it was.agentEnvintrial.tsadds only the provider to the side's closed environment. Its tokens still come from the environment (CLAUDE_CONFIG_DIR,ANTHROPIC_API_KEY,CLAUDE_CODE_OAUTH_TOKEN, each passed when set), next to the login in HOME, so Claude Code's own precedence still decides between them. Eval still picks one token.X-Api-Key, doesn't mark it as secret. So the sanitizer now treats a*_HEADERSvariable as headers, whether or not its name is also secret-named (secretsInEnv). It collects the whole value and each line's value, everything after the line's first colon. One header a line is how Claude Code readsANTHROPIC_CUSTOM_HEADERS, so a value with commas or colons in it is redacted whole rather than guessed apart. Trial's sanitizer reads each agent's environment, so this covers its progress lines, its section and--json. Eval'sreadSignInsnow calls the same function instead of its own copy.ANTHROPIC_BASE_URLnames the developer's own host. It's redacted whole, along with any credentials in its userinfo. Its host is redacted too, with and without its port, both as written and asURLlowercases it, because an error can name the host alone. A loopback host (localhost,127.x,[::1], a trailing dot included) is left alone. So is a bare name with no dot, likegpubox, unless it comes with its port: on its own it could match inside ordinary words. Eval gets the same, and its section's redaction line now names header values and the provider's address too.The new test in
trial.test.tswrites a dummy provider into a temporary HOME's.claude/settings.json, then checks the agent's environment and the redaction. Removing either half of the fix makes it fail:Two cases in
sanitize.test.tspin the header rule. The first is a secret-namedCOOKIE_HEADERSwith a header on each line and a colon in one value, which fails if the secret name takes precedence:The second checks that a comma-joined line's whole value is redacted, and that
http://localhost:4000survives a header likeX-Forwarded-For: 192.0.2.1, ::. That second part fails against the comma splitting this PR tried and dropped:A third pins the provider's address:
127.0.0.1:4000and other local URLs survive;hdoesn't garblehandler;gpubox:8317is redacted, whilegpuboxalone isn't.It fails without the rule.
How it was verified
vitest run scripts/dev: 20 files, 193 tests pass. That includes eval's provider tests, unchanged except for whereclaudeEnvis imported from. One assertion also expects the provider's address and host among eval's collected secrets.pnpm lint,pnpm typecheck(25 tasks, tests included) andbun fmt --checkpass.Surfaces: the dev loop applied.
docs/DEVELOPMENT.md's trial paragraph now says where the provider comes from, and its sanitizer paragraph says how a headers variable is redacted (whole, and oneName: valuea line, as Claude Code reads them) and how the provider's address is. Thepatchy-dev-loopskill doesn't describe trial's sign-in, so it needed no change, and the seed and Postgres template are untouched. The wire contract, CLI, vocabulary and migrations don't apply.Release impact
Tick exactly one.
Breaking — requires action from anyone already running this
Not breaking — no action required: dev runner only, nothing in the CLI, server or schema
What does a revert leave behind? Nothing. Trial goes back to not passing the provider.
Does the release before it still work with that? Yes.
Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.