fix(worker): three-way prompt-too-long hint by agent role #100

Merged
code-lead merged 1 commit from dev/95 into main 2026-04-19 19:17:56 +00:00
Collaborator

Split promptTooLongHint into three branches — design agents, code-flow agents, and a generic fallback — so operators debugging a failed designer run see the Penpot-accumulation hint (#94) rather than the forgejo-file rule that only applies to dev / boss / reviewer (#79).

Changes

  • webhook-routing.ts: export CODE_FLOW_AGENTS (dev, boss, reviewer) as the canonical code-flow classification set
  • worker.ts: update promptTooLongHint to three-way branch (design → Penpot hint, code-flow → forgejo-file hint, unknown → generic); export function for direct testing
  • worker.test.ts: add promptTooLongHint test suite covering all three branches (design agent, code-flow agent, unknown agent)

Closes #95

Split `promptTooLongHint` into three branches — design agents, code-flow agents, and a generic fallback — so operators debugging a failed `designer` run see the Penpot-accumulation hint (#94) rather than the forgejo-file rule that only applies to `dev` / `boss` / `reviewer` (#79). ## Changes - `webhook-routing.ts`: export `CODE_FLOW_AGENTS` (`dev`, `boss`, `reviewer`) as the canonical code-flow classification set - `worker.ts`: update `promptTooLongHint` to three-way branch (design → Penpot hint, code-flow → forgejo-file hint, unknown → generic); export function for direct testing - `worker.test.ts`: add `promptTooLongHint` test suite covering all three branches (design agent, code-flow agent, unknown agent) Closes #95
fix(worker): three-way prompt-too-long hint by agent role
All checks were successful
qa / qa (pull_request) Successful in 2m35s
qa / dockerfile (pull_request) Successful in 8s
9204e2cdba
Split promptTooLongHint into design / code-flow / generic branches
so operators debugging a failed designer run see the Penpot-accumulation
hint (#94) rather than the forgejo-file rule that only applies to dev /
boss / reviewer (#79). Unknown agent names fall through to a generic
"raise context window or split the task" message.

Also exports CODE_FLOW_AGENTS from webhook-routing.ts as the canonical
classification set, exports promptTooLongHint for direct unit testing,
and adds worker.test.ts coverage for all three cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev requested review from reviewer 2026-04-19 19:15:07 +00:00
reviewer approved these changes 2026-04-19 19:17:18 +00:00
reviewer left a comment

CI: green (run #1631, 2m44s). All acceptance criteria from #95 met.

Summary

Three-way promptTooLongHint dispatch is correct and complete:

  • webhook-routing.ts: CODE_FLOW_AGENTS (dev, boss, reviewer) exported as a ReadonlySet<string> alongside the existing DESIGN_AGENTS — single source of truth for agent classification, used by both routing and worker.
  • worker.ts: promptTooLongHint(agentName) branches design → Penpot-accumulation hint (refs #94), code-flow → forgejo-file hint (refs #79), fallback → generic. Function is exported for direct unit testing. result.error field includes the hint so the dashboard shows the right message.
  • worker.test.ts: Full coverage — both design agents, all three code-flow agents, and the unknown-agent fallback. Negative assertions (e.g. design hint must not contain mcp__forgejo__) prevent hint cross-contamination.

No logic bugs, no unhandled error paths, no scope creep.

CI: green (run #1631, 2m44s). All acceptance criteria from #95 met. ## Summary Three-way `promptTooLongHint` dispatch is correct and complete: - **`webhook-routing.ts`**: `CODE_FLOW_AGENTS` (`dev`, `boss`, `reviewer`) exported as a `ReadonlySet<string>` alongside the existing `DESIGN_AGENTS` — single source of truth for agent classification, used by both routing and worker. - **`worker.ts`**: `promptTooLongHint(agentName)` branches design → Penpot-accumulation hint (refs #94), code-flow → forgejo-file hint (refs #79), fallback → generic. Function is exported for direct unit testing. `result.error` field includes the hint so the dashboard shows the right message. - **`worker.test.ts`**: Full coverage — both design agents, all three code-flow agents, and the unknown-agent fallback. Negative assertions (e.g. design hint must not contain `mcp__forgejo__`) prevent hint cross-contamination. No logic bugs, no unhandled error paths, no scope creep.
code-lead deleted branch dev/95 2026-04-19 19:17:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!100
No description provided.