Repository navigation
FIX-2378: a task's line says which task it is, as data - #4485
Conversation
…ge items
A conversation's line about a task now carries its data on the item, so an
app reads the task, its ending and what came back without parsing the words.
- contracts/core/engine: optional `metadata` on MessageItem, set through
`ctx.emit.message(text, { metadata })`; never sent to a model.
- orchestration: `noticeMetadata` and `parseNotice` beside `noticeText`, with
a text fallback for lines stored before this (BP-030).
- workforce: every task line and delegate answer is marked;
`delegateAnswerOf` reads the answer marker (root and ./browser).
Spec: specs/issues/FIX-2378 (#4397).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NczDiGDvDM4uyuL6R8WL5Q
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
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. |
Second look + architecture passOverall: the shape is right. A generic opaque 1.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c4a3b379e
ℹ️ 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".
| const marked = item.metadata?.[NOTICE_ITEM_KEY]; | ||
| if (marked !== undefined) return lineOf(marked); | ||
| const text = (item.content ?? []).map((part) => part.text ?? "").join(""); | ||
| return lineFromText(text); |
There was a problem hiding this comment.
Restrict legacy text parsing to unmarked messages
When a delegate's answer quotes a complete notice sentence, parseNotice treats it as a notice even though its metadata explicitly identifies it as a delegate answer. For example, an answer marked { delegateAnswer: { worker: "otto", taskId: "task_new" } } with text Task "Count licenses" (task_old) completed by otto: 12 licenses returns a completion notice for task_old. This makes the two readers classify the same new message differently and can associate the answer with the wrong task, contrary to FIX-2378's requirement that delegate answers return undefined from parseNotice. Limit the legacy fallback to messages without structured classification data rather than all messages lacking taskNotice.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 62a82c7. The spec's E1 says a line that has data is never read off its words, but the fallback only checked for a missing taskNotice key. parseNotice now falls back to the text only for a message with no metadata at all.
A new test covers your case: a delegateAnswer-marked line quoting a task_old notice. It fails without the fix and passes with it. Orchestration 2214/2214 and the workforce markers test (6/6) both pass.
Generated by Claude Code
Mechanism check (advisory, never blocks)Rows from
|
A line that carries any metadata says what it is, so the legacy text fallback now applies only to a line with no metadata at all. A delegate's answer quoting an older notice no longer reads as that notice (Codex review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiGDvDM4uyuL6R8WL5Q
… in the changeset DELEGATE_ANSWER_KEY was exported from its module with no consumer (Fallow); the key stays internal per the spec's E7. The changeset now names FIX-2378. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiGDvDM4uyuL6R8WL5Q
Requested by Jake · project thread
Builds FIX-2378 to its merged spec,
specs/issues/FIX-2378(#4397). Wave 1 package slice of FIX-2369. It touches no app file; the labs adopt the readers in wave 3.What changes
MessageItemgains optionalmetadata, set throughctx.emit.message(text, { metadata })on both message emitters.EmitMessageOptionsis exported from core. The engine never reads it, and history holds the text alone. No task or worker noun enters L1 (ER-1).noticeMetadata(notice, task)andparseNotice(item)sit besidenoticeText.parseNoticereads the data when present and falls back to the words for lines stored before this (BP-030, E1). Malformed data reads as "not a notice".noticeMetadata. A delegate's answer, from the board or the coordinator's two answer sites, carriesdelegateAnswerMetadata({ worker, taskId }).delegateAnswerOf(item)is exported from the root and./browser. The keys stay internal (E7).docs/architecture/items.md, and the Emitting items page.Verification
packages/workforce/test/task-line-markers.test.ts(6 tests, real engine): completion and final-failure lines carrytaskNoticewith the filed task's id and ending. Answers from a coordinator, a worker's own conversation, and a routed message read as{ worker, taskId }.packages/orchestration/test/tasks/parse-notice.test.ts(16 tests): every ending round-trips, a reworded line still parses from its data, and the text fallback is checked againstnoticeText's own output, cascade included. A user quoting a notice, another item type, and malformed data are rejected.packages/engine/test/emit-message-metadata.test.ts(2 tests):metadatarides both the streamed and the stored item, is absent when not given, and never reachesitemToLLMMessages. Control: the engine drops the field and the test fails.coordinator-rounds.test.tshitting its 5s timeout under full-suite load; it passes on its own (39/39 with the markers test).Generated by Claude Code