Repository navigation
FIX-1965: a new task's input is an object, so the chief of staff's coding runs find their project - #3308
Conversation
… send it as a JSON string (FIX-1965) addTask and dispatchTask declared input as z.unknown(), which reaches the model as a schema with no type. The chief of staff (claude-haiku-5-5) filled it with the payload as a JSON string, so the project workspace source read no input.project and every coding run was refused no-project. Typed as an object, the schema tells the model the shape and refuses the string form. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
…ost to the EM (FIX-1965) Since FIX-1872 the chief of staff can post the item to the EM, which puts a post row on the conversation's own board. That row completes when the EM says it handed the work over, so the leg graded each branch before the coder had committed and read it as empty. The leg now picks the row assigned to eng.coder, on the conversation's board or the EM's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 2249fea3-222e-4382-b98d-af570abcc79e) |
|
@codex review |
Second look + architecture passVerdict: approach is right; no changes requested. Is there a better approach? I weighed two alternatives and rejected both.
Scope. +2 lines of source for the schema, one looped test, one changeset, one grader fix. Nothing removable. The comment above Checks I ran
Architecture opportunities. None worth taking in this PR. The only adjacent item: Not verified here: I didn't run the tests or the leg b goal; the PR notes run 2 is still pending, so the grader fix ( Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 8ce81052-259e-4f49-b668-7445023c6934) |
There was a problem hiding this comment.
Problem
Chief-of-staff coding runs were missing input.project because the model sometimes sent task input as a JSON string. Readers use input.<field> on an object, so the project binding never applied.
Did this go too far?
No. The diff is small and the fix is at the right seam.
| Alternative | Why it's worse |
|---|---|
z.preprocess + JSON.parse on strings |
Hides the bug; models keep sending strings |
Runtime repair in execute |
Same, plus every reader must remember to coerce |
Tight z.object({ project: … }) on the tool |
Wrong layer — input is assignee-specific (tool args, coder payload, etc.) |
Change persisted taskSchema.input |
Broader migration/history story; tool boundary is where the model misbehaved |
Tightening addTaskFields.input is the minimal lever: dispatchTask already spreads those fields, metadata already uses z.record(z.string(), z.unknown()), and parse-time refusal gives the model a clear signal.
Simplify / hygiene (optional — not blocking)
- Changeset vs tests — The fragment says string, number, and array are refused; tests only assert the string case. Either add quick
safeParsecases forinput: 1andinput: [], or narrow the changeset wording to match what you prove. - Test placement — The new
describeis schema-only but lives indispatch-task-tool.test.ts(BR-15 replay focus). Moving it beside otheraddTasktool tests (e.g.add-task-records.test.ts) would match file boundaries; keeping it here is still fine. - Goal leg in the same PR —
filedForswitching fromtasks[0]toassignee === "eng.coder"is the right assertion once boards can hold multiple rows (post vs coder). It's related fallout, not extra framework surface. A separate commit/PR would only help reviewers who want orchestration-only diffs. - Defense in depth (follow-up, if you want it) — Persisted
taskSchema.inputstaysz.unknown(); non-tool writers could still store a string. Out of scope if FIX-1965 is model-only; mention only if you want collection APIs aligned later.
Checks
pnpm --filter @flow-state-dev/orchestration test — 1780 tests passed locally (includes the new addTask / dispatchTask schema cases).
Verdict: Approve. This is the cleaner approach; I don't see a simpler design that preserves the "fail closed + teach the model" contract.
Sent by Cursor Automation: Review For Best Approach
| // then misses (a project-bound coder's `input.project`, a tool's arguments). | ||
| input: z | ||
| .unknown() | ||
| .record(z.string(), z.unknown()) |
There was a problem hiding this comment.
Aligning input with metadata here is the right reuse — one addTaskFields edit covers both addTask and dispatchTask. I wouldn't extract a shared helper unless more open-ended object bags start duplicating the same comment/describe pair.
| // handed the work over, before the coder has committed anything. | ||
| const filedFor = async (conversation: string): Promise<Record<string, any> | undefined> => { | ||
| const own = ((await http.act("coordinator", conversation, "listTasks_tasks", {})).output?.tasks ?? [])[0]; | ||
| const coders = (tasks: Array<Record<string, any>>) => tasks.find((t) => t.assignee === "eng.coder"); |
There was a problem hiding this comment.
This fix reads as test harness correction (pick the coder row, not the first task on a multi-row board), not product complexity. If you ever split PRs for scope hygiene, this would be the piece to peel off — not the schema change.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 899dbd207e
ℹ️ 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".
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@flow-state-dev/orchestration": patch | |||
There was a problem hiding this comment.
Mark the breaking input restriction as minor
This fragment explicitly documents that callers passing a string, number, or array will now be rejected, so existing consumers can trip over this change. Publishing it as a patch can deliver the breaking validation behavior through an existing compatible version range; mark @flow-state-dev/orchestration as minor under the repository's pre-1.0 release policy.
AGENTS.md reference: AGENTS.md:L34-L39
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The pre-1.0 policy in AGENTS.md says minor for a change existing code can trip over, and a caller passing a non-object input now does. The next push changes the fragment to minor.
Generated by Claude Code
| // then misses (a project-bound coder's `input.project`, a tool's arguments). | ||
| input: z | ||
| .unknown() | ||
| .record(z.string(), z.unknown()) |
There was a problem hiding this comment.
Document the object-only task-tool input contract
This changes the published taskTools and taskToolActions schemas to reject scalar and array payloads, but the package README's task-tools section does not document that new restriction. Consumers following the current public documentation can therefore send a previously accepted payload and receive an unexpected validation failure; update the package API documentation alongside this behavior change.
AGENTS.md reference: AGENTS.md:L203-L211
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The next push adds the object-only input rule to the README's Task tools section, along with test cases for a number and an array (the changeset already names both).
Generated by Claude Code
Codex Review SummaryThis 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. |
…or, test number and array Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: ad1b6bda-20ac-4e4e-bf55-4e4f9f125240) |
There was a problem hiding this comment.
Code Snob
A smaller shape of the same contract is #3310 (poc/shorter-task-input-object @ cd2573c6a). Net −9 against 899dbd207. Fold that subtraction into this PR. After this PR lands, close the POC unmerged. The POC body says it does not merge. This token cannot mark it draft.
addTaskFields.inputinpackages/orchestration/src/skills/task-tools-capability.ts: keep one line,`unknown` has no type, so a model may send this payload as a JSON string.The three-line comment repeats the describe ("a JSON object, not a string") and namesinput.projectand a tool's arguments. The tool description and the test payload already carry those readers.packages/orchestration/test/skills/dispatch-task-tool.test.ts: drop the comment under the describe. The describe title and eachitname already say string versus object. Drop thesafeParsecast.GeneratorTool.inputSchemaalready hassafeParse. Find the tool the waydispatchTooldoes, and throw`${name} is not offered`when the find misses. Build the tool list once.filedForingoals/shift-manager/it-opens-on-fsd-and-shift-manager/run.mts: keep two lines. The coder's row, never the post, because that row completes when the EM says it handed the work over, before the coder has committed. The two board lookups are the function body.
Left as recorded: z.record(z.string(), z.unknown()), the same shape as metadata. The describe suffix stays. Both tools refuse a JSON string and accept the object { project: { visibility: "shared", id: "shift-manager" } }. filedFor still picks eng.coder on the conversation's board, then on an EM session under it. The changeset stays. FIX-1969 stays filed and unfixed.
dispatch-task-tool.test.ts: 8 passed. With input set back to z.unknown().optional(), both refusal tests failed (expected true to be false). The record schema was restored before the POC commit.
Sent by Cursor Automation: Code Snob
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
|
Code Snob review: I folded #3310's subtraction into fd84e4f. That brings the one-line schema comment, the test without the cast (a tool list built once, throwing when a tool is not offered) and the two-line Generated by Claude Code |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: ea8d64d2-c851-40d1-9f5b-adbd6cc82722) |
There was a problem hiding this comment.
Code Snob
The note that counts is this one, for head 6b5932872. The earlier review describes 899dbd207 and points at cd2573c6a. Do not fold that commit. It was cut before the minor changeset, the README sentence, the goal.md rows, and the number and array expects.
The subtraction still holds, now on #3310 @ 05e200591. Net −9 against 6b5932872. Fold that. After this PR lands, close the POC unmerged. The POC body says it does not merge. This token cannot mark it draft.
Keep, from 6b5932872:
- the changeset at
minor - the README sentence on a new task's
input - the two
goal.mdrows for 2026-10-14 - the expects for
input: 1andinput: [project]
The shorter test already contains those two expects.
Same drops: the three-line comment on addTaskFields.input down to `unknown` has no type, so a model may send this payload as a JSON string. The test comment goes. The safeParse cast goes; find the tool the way dispatchTool does. filedFor's comment keeps the post-row reason and drops the retelling of the two board lookups.
Left as recorded: z.record(z.string(), z.unknown()), the describe suffix, eng.coder on the conversation's board then the EM's, FIX-1969 unfixed.
The two refusal tests passed on 05e200591: string, number, and array refused; the object accepted.
Sent by Cursor Automation: Code Snob
There was a problem hiding this comment.
Code Snob
The note that counts is this one, for head fd84e4f30. The fold is already in that commit. Close #3310 unmerged. Do not apply cd2573c6a or 05e200591 again.
The review that names 6b5932872 is stale. fd84e4f30 already has the one-line schema comment, the test without the cast, the number and array expects, and the two-line filedFor comment. The minor changeset, the README sentence, and the two goal.md rows are still there.
What remains between fd84e4f30 and the POC is the same size: the filedFor comment's word order, and base sitting inside the test instead of above it. Moving either does not shrink the contract.
Sent by Cursor Automation: Code Snob


Requested by Jake · project thread
The problem
On a fresh
pnpm shift-manager:dev, when a person asked the chief of staff for coding work on FSD or Shift Manager, the coder's task errored within a second withno-project. No worktree was made and Claude Code never ran. The chief of staff (anthropic/claude-haiku-5-5) sent the task'sinputas a JSON string ("{\"project\":{...}}"). The tool declaredinputasz.unknown(), so it took the string, and the project source reads onlyinput.project.What this does
addTaskanddispatchTasknow typeinputas a JSON object. The model now seestype: objectin the schema, and a string is refused at the tool with a validation error that tells the model to send the object.The FIX-1904 fresh-open check (leg b) also graded the wrong row. Since FIX-1872 the chief of staff can post the item to the EM, and that post row completes as soon as the EM says it handed the work over. The leg graded each branch at that moment, before the coder had committed. The leg now grades the row assigned to
eng.coder.What's asked of you
Nothing. This is a bug fix with no product call in it.
Parts worth reviewing closely
packages/orchestration/src/skills/task-tools-capability.ts:addTaskFields.inputbecomesz.record(z.string(), z.unknown()). This is the same shapemetadataalready uses. A caller that passed a string, number or array as a task's input is now refused. I found no such caller in the repo: tool assignees take objects as arguments, and the planner paths that use string inputs don't go through these tools.goals/shift-manager/it-opens-on-fsd-and-shift-manager/run.mts:filedForpicks theeng.coderrow on the conversation's board or the EM's board, never the post row.Links: Linear FIX-1965 (child of epic FIX-1903) · bug on the direct route, no spec · merges when approved.
How to review this
How to review this. This is a bug fix on the direct route: there is no spec and no spec PR, because the hard part was the diagnosis and it happened in code. This PR is the only gate, so unlike a spec-backed change, the approach is in scope: nothing here was signed off upstream.
Most valuable here: the diagnosis chain. Does the repro actually reproduce the reported failure, is the named cause the real one, does the fix address that cause rather than the symptom, and does the regression test fail without the fix? Then the second path (the legacy shape, the null boundary, the concurrent case, the cancel path).
In scope to challenge: where the guard was placed, any behaviour change a user could notice, and whether this should have been a spec'd feature instead of a fix.
Engineering calls
other-projectfailure in the FIX-1797 closure runs is a different cause. There the input is an object naming a guessed project id. I filed it as FIX-1969 and did not fix it here.Everything else: verification
dispatch-task-tool.test.ts, "a new task's input is an object") fails on both tools when the source change is reverted (2 failed) and passes with it. It also covers a number and an array.pnpm typecheckpasses. Tests pass for orchestration (1780), workforce (1295), patterns (229) and harness-manager (271). Fourshift-managercheckout.test.tscases fail in this container both with and without this change, because the container has a Claude sign-in and those cases expect none.main, and Claude Code committed the file (for example08331b6a"Add goal-scratch marker file"). There was nono-project. The leg failed only oncommits-the-file, because it graded before the commit (see above).anthropic/claude-haiku-5-5): PASS. Both tasks completed, each in one new worktree of this checkout underfsd-runs, on a branch frommainand not the checked-out branch, committing the item's file with its stamp. Both runs are recorded in the goal's verdict log.A changeset is included:
@flow-state-dev/orchestrationminor, because a caller passing a non-object input is now refused (pre-1.0 policy). The package README's Task tools section documents the rule.🤖 Generated with Claude Code
https://claude.ai/code/session_01FRaeKmUbDzgVCd7qczMuVa
Note
Medium Risk
Tightening
addTask/dispatchTaskinput is a breaking API change for any caller that passed a non-object (documented as minor pre-1.0); the goal-script change only affects verification, not production routing.Overview
Fixes FIX-1965: chief-of-staff coding tasks were failing with
no-projectbecause models could send taskinputas a JSON string underz.unknown().addTaskanddispatchTasknow schemainputas a JSON object (z.record(...)), so strings, numbers, and arrays are rejected at validation and the tool schema exposestype: object.The FIX-1904 goal leg b harness was grading the wrong task: it used the first board row (the chief-of-staff → EM post, which completes when the EM hands off).
filedFornow selects the row withassignee === "eng.coder"on the conversation or EM board, socommits-the-filewaits for the coder’s commit.Also: orchestration README + changeset (minor: non-object
inputis now refused), and regression tests on both tools’inputSchema.Reviewed by Cursor Bugbot for commit fd84e4f. Configure here.