Skip to content

FIX-2342: Teammates lab runs coding tasks on Claude Code, Codex or Cursor, named by the worker - #4222

Merged
jhoffner merged 4 commits into
mainfrom
claude/project-thread-mbvhei
Oct 29, 2026
Merged

jhoffner merged 4 commits into
mainfrom
claude/project-thread-mbvhei

Conversation

@jhoffner

@jhoffner jhoffner commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Jake · project thread

Closes FIX-2342 (under FIX-2152). Builds on FIX-2341 (#4216, merged); based on main.

Also on this branch: the coding-agent screen test runs at a slower fixture speed so it can see the line before the run reports its model (at fast() speed that window was 30ms and the test flaked; a control with the model reported at once fails it).

Known red, not this PR's: test/inventory.test.ts in labs/teammates fails on main too. The README's inventory table was removed on purpose, and #4176 removes the inventory script's table check. It goes green once #4176 merges.

What changes

  • Three coding agents, one per harness, set in their worker files (ER-9).
    • The lab's coder worker is now claude-code, and codex and cursor join it. Each WORKER.md names its harness:, and all three run on the lab's one coding flow. The task row gets no harness field.
    • They stay off the teammate list and can't be messaged, like coder before them (FIX-2332).
    • The coding flow is registered with showSettings: ["harness"], so each worker's harness rides on its roster row.
  • Chief of Staff assigns the agent you name. "Have Codex do it" files the task to teammates.codex. With no agent named, it assigns to teammates.claude-code and goes ahead without asking.
  • A harness this machine isn't set up for fails the task at once, and nothing else runs instead.
    • Before a run starts, the flow runs that harness's own sign-in check: Claude Code's account probe, Codex's account probe, and Cursor's cursorSignIn.
    • A failed check fails the task with one plain line, such as "Codex isn't set up on this machine: Not logged in. Sign in with codex login, then start the task again."
  • The task line names the harness. The line in the conversation, the Background item and the task popup are tagged with the agent from the worker's setting. The model is added only when the run reports one (taskSpendView); nothing is guessed.
  • The host wires Cursor. It adds @flow-state-dev/cursor with Kitchen Sink's settings for a local run: composer-2.5, the SDK's sandbox off, and the same env pass list.
  • README and the goal's wording are updated.

What's missing

  • Cursor under the lab's default runs folder fails with ENAMETOOLONG (FIX-2344). The Cursor SDK names a folder after the run's whole cwd flattened into one name, and harness-manager's worktree paths are about 242 characters before the root. This is a package fix (ER-4). The README lists it under Not wired yet, and a short runsRoot works today.
  • On a real host the model shows when the task ends, not while it runs. The lab reads the model off the board's task-change rows, and a run's live spend writes none. A live read is a package follow-up (Codex review thread).
  • Coding tasks left pending under the old teammates.coder in an existing local store fail as assigned to a fired worker. Delete .fsdev/teammates.sqlite after upgrading.
  • On the machine this was checked on, only Cursor is signed in. Claude Code and Codex fail plainly, as designed.

Verification

  • labs/teammates vitest: all pass except the inventory test above. New screen tests:
    • Named agent and default: a task with no agent named runs as Claude Code with no model shown. A Codex task is tagged Codex, then Codex · gpt-5.5-codex once its model is reported, on the line, its accessible name and the popup. A Cursor task is tagged Cursor. None of the three shows in the teammate list.
    • Not set up: with Cursor not set up, a Cursor task fails at once with the line naming Cursor, and no run starts on another agent.
  • Red state: with the old TaskCard, 5 screen tests fail.
  • Real host (openTeammates on a scratch git checkout):
    • roster() returns harness for the three coding workers.
    • A real Codex task ends errored with "Codex isn't set up on this machine: Not logged in. Sign in with codex login, then start the task again." No other harness ran.
    • A real Cursor task with a short runs root completes. It fixed the README typo in its worktree, committed it, and reported its spend.
  • Lab typecheck, eslint, check-retired-terms, goals tsc and vite build pass.
  • Not checked: a real Claude Code or Codex run (neither is signed in here), the real-model goal run, and how it looks in a real browser.

No changeset: the lab is private.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NczDiEeU2NQEBYRRxCJf5b

…the worker

Three task-only coding workers, one per harness, each naming its harness
in WORKER.md (ER-9), all on the lab's one coding flow. Chief of Staff
assigns the one the user names, else Claude Code. A harness this machine
isn't set up for fails the task at once with a line naming it, and never
runs on another. The task line, its popup and the Background item name
the harness, and the model only once the run reports one.

Cursor under the lab's default runs folder hits ENAMETOOLONG (FIX-2344).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiCsRqCenZsFQRpJBHi
(cherry picked from commit b8dfbd4)
…label test a window it can see

Main's README dropped the table, which the inventory test requires; the
table is regenerated from the lab as it is now. The coding-agent screen
test looked for the line before the run reports its model, a 30ms window
at fast() speed, so it runs at 0.3.

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

vercel Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

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

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Oct 29, 2026 11:37pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Oct 29, 2026 11:37pm UTC
flow-state-dev-ui Ignored Ignored Preview Oct 29, 2026 11:37pm UTC

Request Review

@jhoffner jhoffner self-assigned this Oct 29, 2026
@linear-code

linear-code Bot commented Oct 29, 2026

Copy link
Copy Markdown

FIX-2342

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-10-29T23:39:33.606399Z 3092021 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.

Copy link
Copy Markdown
Collaborator Author

Second look + architecture pass (read-only review of b8946e6)

The shape is sound. The ER-9 routing (worker file names harness:, one flow, one manager per harness) is the lean option, and failing fast instead of falling back is right. Findings below are ordered by value; none block the approach.

1. CURSOR_PASS is now a second hand-copied list (worth doing in this PR)

labs/teammates/host.mts:123 re-declares the pass list that already lives in apps/kitchen-sink/lib/cursor-mode.ts:66 (with a doc comment explaining why). Claude Code and Codex export theirs from the package (CLAUDE_CODE_PASS, CODEX_PASS); Cursor is the odd one out, which is exactly why a host has to copy it. Same for "composer-2.5" (CURSOR_DEFAULT_MODEL in kitchen-sink). Two copies of a security-relevant env allowlist will drift (add a proxy var to one, forget the other).
Suggestion: export CURSOR_PASS (and the default model if it belongs there) from @flow-state-dev/cursor, import it in both kitchen-sink and the lab. This PR is the natural moment since it creates the second consumer. It is a published-package change (ER-4), so it also needs a changeset, and it can ride with the FIX-2344 package fix if you'd rather not widen this PR.

2. Readiness probes handle rejection inconsistently (host.mts READY)

Cursor's probe has .catch(...) that turns a throw into the plain "isn't set up" line. The Claude Code and Codex probes don't: if probeCodexAccount / probeClaudeAccount reject (binary missing, spawn error), the task fails with a raw error instead of the one plain line the PR promises. Fold the catch into one wrapper around every READY entry rather than only Cursor's, so the contract ("fails with one plain line naming the harness") holds in all three.

3. Probe runs on every task start, uncached (optional)

execute awaits options.ready?.[harness]?.() per task. Codex's probe allows up to 30s. A burst of tasks pays that each time, and the failure path (not signed in) is the slowest one. A short per-harness TTL (success only, ~60s) would remove the repeated cost without hiding a sign-out for long. Fine to leave if tasks are rare in the lab.

4. Harness name has two sources on the client (optional simplification)

adapter.ts keeps a closure harnesses map filled only by listWorkers(), and toBoardTask falls back to it when the run hasn't reported spend. Conversation separately passes harnessOf for the placeholder card. Consequences: a watchTasks emission that precedes the first roster read drops the tag; and the lookup is stateful hidden coupling between two adapter methods. WorkerRow.harness already carries it, so resolving the fallback in one UI place (from the roster the screen already holds) would drop the adapter closure state. Worth considering, not required.

5. Casts

cursorAgent({...} as never) as unknown as HarnessBlock mirrors the neighbouring Codex entry, so it matches the file's convention. Noting only that if CursorAgentOptions is exported (it is), typing the literal would catch option drift at compile time; at least for the new entry.

Not an issue / fine as is

  • Three near-identical WORKER.md files: appropriate; they are the intended per-harness config surface.
  • Bundled README-inventory and test-speed fixes are disclosed in the PR body and small.
  • No fallback to another harness, and the red-state evidence for the screen tests, are good.

Net: do #1 and #2; #3–#5 are the implementer's call.


Generated by Claude Code

@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: b8946e68d5

ℹ️ 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".

},
watchTasks(sessionId, onChange) {
return watchFeed(sessionId, (items) => [...boardRows(items).values()].map(toBoardTask), stableList(onChange));
return watchFeed(sessionId, (items) => [...boardRows(items).values()].map((row) => toBoardTask(row, (worker) => harnesses.get(worker))), stableList(onChange));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Read live spend independently of task-change snapshots

During a coding run without subsequent lifecycle or progress events, the model label remains absent even after the harness reports it. This subscription reads only task-change snapshots, but recordSpend deliberately emits no such event (packages/orchestration/src/tasks/collection/resource-backed.ts:1106–1114), and lease renewals emit none either. Read or subscribe to the current task row’s spend so the conversation, background item, and popup update while the task runs; the fixture’s direct BoardTask.model updates bypass this production path.

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.

Confirmed: recordSpend publishes no task-change, so on a real host the model shows with the task's next board change, in practice its ending. Not fixing it in this PR. The read path that exists is polling the board's listTasks_tasks action, as the Claude Code-style lab does, but each list is a request recorded on the Chief of Staff's conversation. This lab reads that conversation's activity and window from its latest 20 requests, so a poll over a long run would push the real turns out of view. The clean fix is a package one, either a throttled board event on live spend or a non-request read of the row, and it's going to Jake as a follow-up. The PR body now says the model appears at the end.


Generated by Claude Code

…tory table

The table was removed on purpose; the inventory script's table check goes
in #4176.

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

Main's README dropped the table on purpose, so the lab's inventory test is
red on main. This is #4176's script, test and package.json change as is;
it no-ops once #4176 lands.

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

Copy link
Copy Markdown
Collaborator Author

Test (3/3) failed on labs/teammates test/inventory.test.ts, and the same test fails on main. Main's README dropped the inventory table on purpose, but the script still checks for it. #4176 removes that check. I ported #4176's inventory.mjs, inventory.test.ts and package.json changes into 3092021 as they are, so they no-op once #4176 merges. The README stays as main has it. All 62 lab tests pass locally, and --control still fails on the planted file.


Generated by Claude Code

@jhoffner
jhoffner merged commit 5b2bcce into main Oct 29, 2026
18 checks passed
@jhoffner
jhoffner deleted the claude/project-thread-mbvhei branch October 29, 2026 23:46
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