Skip to content

fix(hub): tell agents why the hub refused their request - #51

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-11925-show-agents-why-the-hub-rejected-a-document-write
Nov 2, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-11925-show-agents-why-the-hub-rejected-a-document-write

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • ProjectError turns an arktype errors object into the {path, message} list, the only form the workflow HTTP layer passes on to an agent's tool result. Before this, reasons were .summary strings, so a model saw only {"code":"invalid_artifact_write","status":400} and repeated the same call.
  • Every hub refusal that sent issues: x.summary now sends issues: x, a one-word change at each site. Strings no longer typecheck as issues.
  • Reasons name the rule, never the submitted value: issue.expected is used for narrow/type rules, is not allowed here for undeclared keys, and is not one of the allowed values for unions whose description embeds the value.
  • The document write's hand-written checks name their field with what to do, for example approaches: "goes on the approaches document; write this problem_brief without it".
  • Security refusals (403/404) still carry only a code.

Folds in #52.

How it was verified

  • apps/hub/src/projects/errors.test.ts runs write_artifact through the workflow HTTP layer against the hub routes and checks typeIssues across .narrow(), unions and undeclared keys with no submitted value in any message.
  • bun run test, lint, format and typecheck pass.

Refs CL-11925, CL-11927

@linear-code

linear-code Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

CL-11925

CL-11927

@TheGreatAxios
TheGreatAxios force-pushed the cl-11925-show-agents-why-the-hub-rejected-a-document-write branch 2 times, most recently from 26fd890 to a78ac24 Compare November 1, 2026 21:26
@TheGreatAxios TheGreatAxios changed the title fix(hub): tell agents which field a rejected document write got wrong fix(hub): tell agents why the hub refused their request Nov 1, 2026
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review November 1, 2026 23:23
@corbits-triage

corbits-triage Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Triage will approve, request review.

corbits-triage[bot]
corbits-triage Bot previously approved these changes Nov 1, 2026
@TheGreatAxios
TheGreatAxios force-pushed the cl-11925-show-agents-why-the-hub-rejected-a-document-write branch from a78ac24 to f9abd5b Compare November 2, 2026 00:42
@TheGreatAxios
TheGreatAxios added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 0e292be Nov 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant