Skip to content

feat(kitchen-sink, shift-manager, labs): a trusted repository's conventions load with hooks off (FIX-2421, stacked on FIX-2398) - #4427

Merged
jhoffner merged 31 commits into
claude/project-thread-t857lkfrom
claude/project-thread-6j0831
Nov 1, 2026
Merged

jhoffner merged 31 commits into
claude/project-thread-t857lkfrom
claude/project-thread-6j0831

Conversation

@jhoffner

@jhoffner jhoffner commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Requested by Jake · project thread

The problem

A Kitchen Sink session on flow-state-dev sees no CLAUDE.md, no skills and no Linear, so it is a worse agent than the CLI in a terminal. Shift Manager and the labs have the opposite problem: they load the repository's settings with its hooks on, and two of them also load the operator's own Claude Code settings. A hook runs by itself, shows in no transcript, and a turn can write one for the next turn.

What this does

  • Kitchen Sink reads two new settings, in the same reader as KITCHEN_SINK_HARNESS_WORKSPACE: KITCHEN_SINK_HARNESS_TRUSTED=1 and KITCHEN_SINK_HARNESS_PASS=LINEAR_API_KEY,GH_TOKEN. Only the server's environment sets trust; a request that claims it changes nothing (BP-031). Off on Vercel.
    • Trusted, Claude Code mode loads the repository's project settings, CLAUDE.md and skills, with settings: { disableAllHooks: true } above them (D1). Never user settings.
    • Trusted, Codex mode stops turning off the operator's MCP servers. AGENTS.md loads either way.
    • Cursor mode loads nothing from the repository, trusted or not. Its SDK can't keep hooks out.
    • Every mode is handed the named keys, and only when trusted.
  • Each session's header gains "Repo conventions: loaded, hooks off" (or "not loaded", or the Codex and Cursor wording) and "Keys passed: …". The line is worked out from the options the mode's runs are built with, not from the setting.
  • Shift Manager (fsd coder and error reporter), Teammates and the Claude Code-style lab load the checkout's conventions with hooks off and no user settings, with no setting (D2).
  • Both app copies of CURSOR_PASS are deleted. Kitchen Sink and Teammates import the cursor package's list, which is byte-identical.
  • The Kitchen Sink README covers both settings, says the model can read a named key, and says what each mode loads.

What's asked of you

Nothing new to decide. This applies the spec's signed decisions (D1 hooks off; D2 the same rule in Shift Manager and the labs).

Merge order. This is fifth on the harness-session.tsx stack (2410 → 2386 → 2384 → 2398 → 2421) and is based on FIX-2398's branch. It also carries PR 1, the package slice, as one commit applied from its patch (0a4bbf2), because that branch isn't pushed yet. When PR 1's branch exists, I merge it in here. Merge this only after PR 1 and FIX-2398.

Parts worth reviewing closely

  • apps/kitchen-sink/lib/harness-workspace.ts → readHarnessTrust: only 1 turns it on; names are read only when trusted; a bad name turns the harness modes off with a reason instead of being skipped.
  • apps/kitchen-sink/lib/claude-code-mode.ts → claudeCodeRepoOptions / claudeCodeRepoLine: the header is derived from the options, so the hooks-on control reads "loaded, hooks on".
  • apps/kitchen-sink/lib/codex-mode.ts → codexClient: trusted, it never lists MCP servers, so nothing is turned off.
How to review this: altitude, what's in scope, what's deliberately unsettled

How to review this. This implements an approved spec. The approach and the numbered
decisions in its DECISIONS.md are signed off by a human, so please review the
code against that direction, not the direction itself. The canonical set is retained
at specs/issues/FIX-2421/.

Most valuable here: correctness on the second path (the legacy shape, the null
boundary, the concurrent case, the cancel path), anything deriving an auth or routing
decision from caller-controllable input, and a behaviour the tests assert around
rather than on.

Already settled upstream: the approach and every decision in the spec's DECISIONS.md,
and the conventions in docs/contributing/best-practices.md.

Engineering calls: decided along the way, no product sign-off needed
  • Setting names as the spec proposed: KITCHEN_SINK_HARNESS_TRUSTED, KITCHEN_SINK_HARNESS_PASS. Only 1 means on. Wrong cost: one rename.
  • A bad key name turns the harness modes off with the reason, the way a bad workspace path does. Skipping it would hand a run fewer keys than the operator thinks.
  • Named keys are read only when trusted. "With the setting off, nothing changes."
  • Codex keeps service_tier: "default" when trusted. Trust is about the repository, not the account's spend.
  • The Shift Manager error reporter follows D2 too. It runs in the same checkout as the coder. One rule for a run on this repository.
  • Header wording for Codex and Cursor: "AGENTS.md, with your Codex MCP servers on" or "AGENTS.md only, your Codex MCP servers off"; "not loaded (Cursor can't load them with their hooks off)" when trusted. The issue named only Claude Code's two states.
  • The goal check drives Kitchen Sink's own session flow, not a browser. The container runs as root, where Kitchen Sink's mode check refuses Claude Code, and a real browser run adds nothing to what loads. Two host-only knobs (GOAL_HOST_PASS, GOAL_PERMISSION_MODE=default) let it run here. Both are in goal.md, and neither changes what the run loads.
Everything else: verification, red states, files

Goal check goals/kitchen-sink-harness/a-trusted-session-follows-the-repo/, real Claude Code (CLI 2.1.316, Agent SDK 0.3.234), three turns through claudeCodeSessionFlow, each turn's input claiming trusted: true:

  • Real: PASS. Code word answered with no tool used, zebra-check listed, named key printed, no hook marker after three turns, header "loaded, hooks off" naming the key.
  • GOAL_CONTROL=hooks-on: FAIL (expected) on hooks:off and header only. A first run of this control also missed the code word (a model miss); the rerun named it. Both are logged.
  • GOAL_CONTROL=untrusted: FAIL (expected) on code word ("NONE"), skill ("NO"), named key and header, with every turn claiming trust.

Red before green (each mutation applied, the named test failed, then reverted):

  • No hooks-off layer in Claude Code mode → harness-session.test.ts "trusted … every hook off" fails.
  • Any non-empty value trusts → harness-trust.test.ts "only 1 turns it on" fails.
  • Names read when untrusted → harness-trust.test.ts and the Codex untrusted-key case fail.
  • Codex keeps the MCP-off overrides when trusted → codex-session.test.ts trusted case fails.
  • Header line dropped → both harness-session-repo-line.test.tsx cases fail.
  • Shift Manager without the repo options → mcp-servers.test.ts "the harness a Lab runs" fails.

Green

  • Kitchen Sink: 50 files, 414 tests pass. Typecheck clean (KS and its deps, Shift Manager, Teammates, Claude Code-style lab, goals). Lint clean on the changed files.
  • Teammates: 75 pass. Claude Code-style lab: 83 pass.
  • Shift Manager: 579 pass; 1 fails in command.test.ts because this container has no built pages (dist-client), unrelated to this change.

Known gaps

  • The two labs have no unit test on their Claude Code options; their harness tables aren't exported. The edit is the same two lines as Shift Manager's, which is tested.
  • specs/issues/FIX-2421/poc/project-settings-hooks/facts.mjs describes the state before this PR and no longer matches it, as intended.

Changeset: none. Kitchen Sink, Shift Manager's team files and the labs are private.

Files

  • apps/kitchen-sink/lib/harness-workspace.ts: the two settings, readHarnessTrust.
  • apps/kitchen-sink/lib/harness-trust.ts: the server's trust (with the untrusted goal control) and the RepoLine type.
  • apps/kitchen-sink/lib/{claude-code,codex,cursor}-mode.ts: each mode's options, env and header line; Cursor's CURSOR_PASS copy deleted.
  • apps/kitchen-sink/components/harness-{mode-page,mode-view,session}.tsx: the header line.
  • packages/shift-manager/teams/devteam/harness.mts, labs/teammates/host.mts (its CURSOR_PASS copy deleted), labs/claude-code-style/workforce/flows/harness-thread.mts.
  • Tests: apps/kitchen-sink/test/harness-trust.test.ts, harness-session-repo-line.test.tsx, additions to harness-session, codex-session and cursor-session tests; packages/shift-manager/test/mcp-servers.test.ts.
  • apps/kitchen-sink/README.md, and the goal check.

Spec: specs/issues/FIX-2421/ (spec PR #4407) · Linear FIX-2421 · epic FIX-2369.


Generated by Claude Code

A trusted Kitchen Sink session loads the repository's conventions
(CLAUDE.md, skills) and the keys the operator names, with the
repository's hooks off. Wave-1 package slice: a settings layer in
claude-code and a CURSOR_PASS export in cursor; the app PR follows.
POC: the issue's settingSources ['project'] alone runs project hooks;
disableAllHooks keeps conventions and stops them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiFUL7CTUSZikwbMGcT
…CURSOR_PASS copies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiFUL7CTUSZikwbMGcT
…xists

Applied verbatim from /mnt/project-files/FIX-2421/pr1.patch so the app wiring
builds against the settings option and the CURSOR_PASS export. Replaced by a
merge of PR 1's branch once it is pushed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiEz7iQL5uMFfnRQd9A
…ntions load with hooks off (FIX-2421)

Kitchen Sink reads two new settings beside KITCHEN_SINK_HARNESS_WORKSPACE, in
its one reader: KITCHEN_SINK_HARNESS_TRUSTED=1 and KITCHEN_SINK_HARNESS_PASS.
Trusted, Claude Code mode loads the repository's project settings, CLAUDE.md
and skills with every hook off; Codex keeps the operator's MCP servers;
Cursor still loads nothing. Every harness is handed the named keys. Each
session's header says "Repo conventions: …" from the options its run gets,
and names the keys. Only the server's environment sets trust.

Shift Manager's fsd coder and error reporter, the Teammates lab and the
Claude Code-style lab keep loading the checkout's conventions, now with hooks
off and never the operator's user settings (D2). The two app copies of
CURSOR_PASS go; both import the cursor package's.

Goal check goals/kitchen-sink-harness/a-trusted-session-follows-the-repo
passes on real Claude Code; its hooks-on and untrusted controls fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiEz7iQL5uMFfnRQd9A
@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Nov 1, 2026 1:24pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Nov 1, 2026 1:24pm UTC
flow-state-dev-ui Ignored Ignored Preview Nov 1, 2026 1:24pm UTC
flow-state-dev-build-site Skipped Skipped Nov 1, 2026 1:24pm UTC

Request Review

@jhoffner jhoffner self-assigned this Nov 1, 2026
@linear-code

linear-code Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

FIX-2421

FIX-2398

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T13:27:05.327908Z e09e37b New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

jhoffner commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

Second look + architecture pass (FIX-2421)

Reviewed against the approved spec direction (D1/D2), not the direction itself. Overall the approach is sound and lean: one reader, header derived from options, trust from server env only. Findings below, ranked. Nothing blocks on the design; #1 needs a check before merge.

1. Hooks-off may not cover the other self-executing project config (correctness / security, verify)

settings: { disableAllHooks: true } turns off hooks. The stated threat is "a turn writes config that runs by itself on the next turn, in no transcript." With settingSources: ["project"] the run also loads other project config a turn can write and that executes or redirects without a transcript line:

  • .mcp.json / project-enabled stdio MCP servers (a command that runs at session start). strictMcpConfig is only set when mcpTools is passed, so in Kitchen Sink and the labs it is not.
  • statusLine.command, apiKeyHelper, awsAuthRefresh-style helper commands, and env in project settings.json.

The PR's POC (project-settings-hooks) proves hooks specifically. Please either extend the goal check/POC to cover a written .mcp.json and statusLine, or state in D1 and the README that hooks are the only vector closed and why the rest is acceptable (the modes run bypassPermissions anyway, so the real boundary is the sandbox, which should be said plainly). Right now the header text "hooks off" reads as stronger than what is enforced.

2. The "trusted repo options" pair is copied four times (reuse / drift)

{ settingSources: ["project"], settings: { disableAllHooks: true } } now lives in claude-code-mode.ts, shift-manager's CLAUDE_CODE_REPO_OPTIONS, labs/teammates/host.mts, and labs/claude-code-style/.../harness-thread.mts. The labs have no tests on theirs (noted under Known gaps), so a future edit to one silently weakens the guarantee. This PR already touches packages/claude-code to add settings; it is the natural place for one exported constant, e.g. PROJECT_CONVENTIONS_HOOKS_OFF (or a repoConventions: "project-hooks-off" option that expands to both keys). Then:

  • shift-manager and both labs import it (and the labs' gap closes via the package test);
  • Kitchen Sink's claudeCodeRepoOptions returns it, and claudeCodeRepoLine can keep deriving from the result.
    Cheap, in the PR's own blast radius, and makes the invariant one definition. I'd do this here rather than as a follow-up, since it is the second time the pair would be hand-copied.

3. codexClient / codexClientOptions encode "trusted → no MCP listing" twice

codexClientOptions does if (trust.trusted) mcpServers = [] (param reassignment) and codexClient separately short-circuits with its own resolver ??= before the untrusted resolver ??=. Two chained ??= on the same variable, where the second is dead when trusted, is easy to misread. Simpler: in codexClient, const names = trust.trusted ? Promise.resolve([]) : listMcpServers(codexEnv()) feeding the one existing resolver, and drop the param reassignment (keep the guard in one place). Same behavior, one path, and the red-state test still applies.

4. Codex "trusted" conflates repo trust with account config

For Claude Code, trusted means "load the repo's config, never the operator's user settings." For Codex, trusted means "stop disabling the operator's own MCP servers", which is account-level config, not the repository. Same switch, different trust object. It may be the right product call (Codex has no repo-level hook layer), but the README/header should say it is the operator's servers being re-enabled, not the repo's. The header string "with your Codex MCP servers on" already does; just make the README match so the asymmetry is explicit rather than discovered.

5. Minor

  • readHarnessTrust returns HarnessTrust & { reason? } while harnessTrust() strips reason: a bad name makes harnessTrust() return untrusted silently if anything calls it without going through readHarnessWorkspace. Today the gate catches it first; a one-line comment at harnessTrust() stating that dependency would help.
  • Merge ordering: the PR carries the package slice as a squashed patch commit (0a4bbf2) and sits fifth in a stack. Fine, but re-check the diff after PR 1 lands so this one doesn't re-introduce settings/CURSOR_PASS differently.

Architecture notes (deletion test)

  • Deleting CURSOR_PASS copies and importing the package list is a clear win; no change requested.
  • harness-trust.ts is a thin module (one function plus a type). It earns its place only via the untrusted goal control; acceptable, but don't grow it.
  • Header "derived from options" is the right shape. Keep it.

No test-intent gaps beyond #1/#2: the red-before-green list in the description maps each mutation to a failing test.


Generated by Claude Code

@cursor cursor Bot 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.

Simplify review (FIX-2421)

Verdict: The product shape looks right — server-only trust via readHarnessTrust, D1 through Claude Code’s settings layer, per-harness differences (Codex MCP on/off, Cursor still no project settings), D2 rollouts, and goal controls are all spec-aligned. I don’t see a materially simpler approach that still meets the verification bar (anti-game goals, hooks-off control legs, BP-031).

What did add complexity is mostly copy-paste and parallel helpers, not wrong architecture. ~half the line count is retained spec/figures/goals/tests, which is expected for this repo.

What I’d simplify (non-blocking)

  1. One D1 bundle, many hosts — { settingSources: ["project"], settings: { disableAllHooks: true } } is duplicated in Kitchen Sink, Shift Manager, and both labs. Export something like TRUSTED_PROJECT_REPO_OPTIONS (or trustedProjectRepoOptions()) from @flow-state-dev/claude-code/sdk, document it next to the settings option, and spread it everywhere D2 applies. Kitchen Sink still gates on trust.trusted; hosts that always trust just spread the constant. This is the highest-leverage cleanup and reduces drift if D1 ever changes.

  2. Header line vs run options — Claude derives the header from claudeCodeRepoOptions (good). Codex/Cursor use hand-written strings in *RepoLine() while MCP/env behavior lives elsewhere; over time those can disagree with what the block actually gets. Consider a single “run policy” object per mode used for both block wiring and RepoLine, or derive Codex’s conventions string from the same flags codexClientOptions uses (trust.trusted → empty MCP disable list).

  3. Kitchen Sink trust surface — harness-trust.ts is a thin wrapper over readHarnessTrust + goalControl; merging into harness-workspace.ts would match “one reader” and cut cross-imports. The three *Env() helpers are the same harnessEnv({ pass: [...PACKAGE_PASS, ...trust.pass] }) pattern — a shared trustedHarnessEnv(packagePass, trust, env) would be enough.

  4. Codex trust threading — codexClient() closes over trust on the trusted path but untrusted MCP-discovery paths call codexEnv() / codexClientOptions(process.env) without passing the closed-over trust (lines called out inline). Works today via default harnessTrust(); passing trust through makes refactors safer.

  5. PR breadth (process, not code) — package slice + Kitchen Sink + Shift Manager + labs + full retained spec + two goals in one PR is a lot to review. If this thread is meant to land atomically, fine; otherwise a package-first merge with a thin app follow-up can shrink review surface without changing behavior.

What looks good / keep

  • readHarnessTrust co-located with workspace gate (invalid pass names fail closed).
  • settings plumbing + argv tests in packages/claude-code — minimal, tested merge with mcpTools.
  • CURSOR_PASS moved into @flow-state-dev/cursor — matches upstream-first / removes host duplication.
  • Trusted Codex skipping codex mcp list is simpler and faster.

Performance

No blockers. Uncached readHarnessTrust on each harness page request is micro-cost; trusted Claude Code loading project settings per turn is the intentional dominant cost.

Skipped (needs product call, not simplify-only)

  • Unifying Claude “nothing until trusted” vs Codex “AGENTS.md always” into one abstraction — behavior differs by design.
  • Removing D2 hosts from this PR — spec D2 explicitly includes them.
Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

* into `.claude/settings.json` for the next turn. The run works only in a
* checkout its operator named, so the conventions load with no setting.
*/
export const CLAUDE_CODE_REPO_OPTIONS = {

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.

Reuse / simplify: This is the same D1 pair as Kitchen Sink (claudeCodeRepoOptions), labs/teammates/host.mts, and labs/.../harness-thread.mts. Consider exporting a single constant or factory from @flow-state-dev/claude-code/sdk (documented next to settings / settingSources in agent.ts) so D2 hosts spread one definition. Shift Manager would keep its comment about why; the literal would live in one place.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Keeping it as it is. PR 1 deliberately ships no hooks-off default or bundle in the package. Its engineering call is that settingSources is plumbing, not policy, and that each host applies D1/D2 itself. A shared constant would put that policy back in claude-code, and it would have to change in PR 1, not here. Today the literal is four copies of two keys, and the goal check and the Shift Manager test catch a host that drifts.


Generated by Claude Code

*/
export function claudeCodeEnv(env: Record<string, string | undefined> = process.env): Record<string, string> {
return harnessEnv({ pass: CLAUDE_CODE_PASS, env });
export function claudeCodeRepoOptions(trust: HarnessTrust = harnessTrust()): ClaudeCodeRepoOptions {

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.

Reuse: Same bundle as CLAUDE_CODE_REPO_OPTIONS in Shift Manager and the labs. If the package exports TRUSTED_PROJECT_REPO_OPTIONS, untrusted stays { settingSources: [] }, trusted spreads the export, and hooks-on goal control only omits settings — less duplication and less chance hosts diverge.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Same answer as on the Shift Manager thread: the package keeps no policy bundle (PR 1's call), so each host writes its own two keys. Keeping it as it is.


Generated by Claude Code

/** The header's line for a Claude Code session, read off the options its run gets. */
export function claudeCodeRepoLine(trust: HarnessTrust = harnessTrust()): RepoLine {
const options = claudeCodeRepoOptions(trust);
const conventions =

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.

Derived state: The nested ternary re-derives header text from options (spec wants header = what the run got). That’s correct for Claude Code; Codex/Cursor still hand-write strings in *RepoLine(). If you consolidate D1 in the package, consider a tiny shared helper like conventionsLabelFromRepoOptions(options) so header logic isn’t duplicated across modes with different shapes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Keeping it as it is. Each harness's options have a different shape, and Claude Code is the only one whose line depends on more than trusted. A shared label helper would have one caller.


Generated by Claude Code

import { readHarnessTrust, type HarnessTrust } from "./harness-workspace";

/** The server's trust, as every harness mode builds its run from it. */
export function harnessTrust(): HarnessTrust {

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.

Organization (optional): This file is mostly harnessTrust() + RepoLine. Merging into harness-workspace.ts would keep “one reader” for workspace + trust and avoid modes importing trust types from workspace and harnessTrust from a second module. Not required for merge.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Keeping it separate on purpose. harness-workspace.ts imports nothing from Kitchen Sink and is pure over its env argument. harnessTrust() adds the goal control, which reads process.env through goal-control. The one reader of the settings is still readHarnessTrust, in harness-workspace.ts.


Generated by Claude Code

}

/** The header's line for a Codex session: `AGENTS.md` always, and whether your MCP servers stay on. */
export function codexRepoLine(trust: HarnessTrust = harnessTrust()): RepoLine {

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.

Header vs block: This string is maintained separately from codexClientOptions / codexClient (trusted → skip MCP disable list). Today they align, but a single policy object (or deriving the label from trust.trusted in one helper used by both block and page) would match the Claude Code pattern and reduce drift risk.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Keeping it as it is. Codex's line and its client options both branch on the same trust.trusted, and a test covers each side: harness-trust.test.ts for the line, and the trusted case in codex-session.test.ts for the options. Codex has no options object to derive the line from the way Claude Code does: the MCP list is read at run time.


Generated by Claude Code

Comment thread apps/kitchen-sink/lib/codex-mode.ts Outdated
let resolver: Promise<ResolveCodexClient> | undefined;
return async (ctx) => {
if (trust.trusted) resolver ??= Promise.resolve(createDefaultResolveCodexClient(codexClientOptions(process.env, [], trust)));
resolver ??= listMcpServers(codexEnv()).then(

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.

Trust threading: Trusted path passes trust into codexClientOptions (good). On the untrusted path, listMcpServers(codexEnv()) and the error fallback codexClientOptions(process.env) rely on default harnessTrust() instead of the trust closed over at factory time. Consider passing the same trust argument everywhere for consistency and safer future refactors (e.g. tests injecting trust).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, that's a fair consistency fix. Today both paths read the same server environment, so the behaviour is the same. Passing the closed-over trust through will ride my next code push on this PR. It doesn't justify a push of its own.


Generated by Claude Code

@cursor cursor Bot 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.

Code Snob — already tight. No POC.

I read the trust reader, the three Kitchen Sink mode builders, the header thread, the claude-code settings forward, Shift Manager's repo options, and the two lab call sites.

The contract is already the small shape:

  • readHarnessTrust is the one environment reader. harnessTrust is the test-mode override on top of it. RepoLine is what the header renders.
  • Each mode's *Env is the existing harnessEnv({ pass: [...X_PASS, ...trust.pass] }) call. A pass-list helper is the shape Decisions already dropped.
  • Claude's header line is read off claudeCodeRepoOptions, so the hooks-on control says "loaded, hooks on". Codex and Cursor report different sentences from the same trust value. One formatter would be a branch table the same length.
  • { settingSources: ["project"], settings: { disableAllHooks: true } } is one option per host (D2). Shift Manager's CLAUDE_CODE_REPO_OPTIONS is already shared by the coder and the error reporter. The labs are separate hosts; a shared constant needs the package policy that was dropped.
  • settings is one optional object, spread when set, and merged under mcpTools so disableClaudeAiConnectors stays last. That is the SDK's one settings bag.
  • repoLine follows the existing page → view → session path. SessionRepoLine is the header.

CURSOR_PASS matches the sibling env-pass.ts files. The Kitchen Sink and Teammates copies are gone. The READMEs and the changeset are that option's public surface.

Files: apps/kitchen-sink/lib/harness-workspace.ts, harness-trust.ts, claude-code-mode.ts, codex-mode.ts, cursor-mode.ts, components/harness-mode-page.tsx, harness-mode-view.tsx, harness-session.tsx, packages/claude-code/src/sdk/agent.ts, packages/shift-manager/teams/devteam/harness.mts, labs/claude-code-style/workforce/flows/harness-thread.mts, labs/teammates/host.mts, packages/cursor/src/env-pass.ts.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

…ame the fake Claude CLI as an entry; thread Codex trust through (FIX-2421)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiEz7iQL5uMFfnRQd9A

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 67971b2304

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2 to +3
"@flow-state-dev/claude-code": minor
"@flow-state-dev/cursor": minor

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use patch bumps for the additive package APIs

Both packages are pre-1.0, and these changes only add an optional settings parameter and the CURSOR_PASS export; existing callers retain their behavior. The BP-022 release policy mandated by AGENTS.md requires patch for additive APIs and reserves minor for breaking changes. Marking both as minor unnecessarily moves them outside consumers' existing caret-compatible version ranges. Change both entries to patch.

AGENTS.md reference: AGENTS.md:L30-L30

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Right. BP-022 (docs/contributing/best-practices.md) says pre-1.0 additive API is patch. Both entries are now patch.


Generated by Claude Code

claude added 15 commits November 1, 2026 00:17
… patch bumps pre-1.0 (BP-022, FIX-2421)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiEz7iQL5uMFfnRQd9A
… (FIX-2421)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiEz7iQL5uMFfnRQd9A
@jhoffner
jhoffner added this pull request to stack #4439 November 1, 2026 12:58

jhoffner commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Changesets name their Linear issue fails here on .changeset/settled-run-ids.md and .changeset/turn-and-task-cost.md. Both are FIX-2398's fragments and are already on this PR's base, claude/project-thread-t857lk.

The next base merge recomputes the merge ref. [Edit: it didn't. On e09e37b, after merging the base at 8353940, the check failed the same way.] Here's what I found:


Generated by Claude Code

@jhoffner jhoffner changed the title feat(kitchen-sink, shift-manager, labs): a trusted repository's conventions load with hooks off (FIX-2421) feat(kitchen-sink, shift-manager, labs): a trusted repository's conventions load with hooks off (FIX-2421, stacked on FIX-2398) Nov 1, 2026
@jhoffner
jhoffner merged commit c68f4e3 into claude/project-thread-2ksmgs Nov 1, 2026
18 of 19 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-6j0831 branch November 1, 2026 19:16
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