Every draft in QA fails. The error reaches the review queue correctly, which is the design working, but the call never succeeds:
Drafting failed: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"anthropic-workspace-id is required when authenticating with an
identity-linked API key; send the id of the workspace this request acts in."}}
What is wrong
anthropicClient.ts constructs the client with an API key and nothing else. That is correct for an ordinary key. An identity-linked key — one issued against a workspace rather than standing alone — additionally requires an anthropic-workspace-id header naming the workspace the request acts in. There is no way to supply one today, so drafting cannot work with that kind of key at all.
Nothing about the key's shape says which kind it is, so this could not have been caught before a real call. #223's task 8 existed precisely to make a real call, and this is what it found.
Fix
Read ANTHROPIC_WORKSPACE_ID and, when set, pass it as a default header on the client. Absent, behave exactly as now — plenty of keys do not need it, and requiring one would break the ordinary case.
Then wire it into both compose files the way the key itself is wired: QA_ANTHROPIC_WORKSPACE_ID for QA, ANTHROPIC_WORKSPACE_ID for production, both optional with an empty default so an unset variable cannot fail a deploy.
What is already right and should not change
The failure handling. The submission survived with its photos, the draft recorded ai_error, the state went to failed after its attempts, and the review queue showed the reason. A model call failing must never lose somebody's consignment, and it did not.
The budget still has no measured number behind it, because no call has yet succeeded. The first successful draft's cost_micros is the figure that should set it.
Every draft in QA fails. The error reaches the review queue correctly, which is the design working, but the call never succeeds:
```
Drafting failed: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"anthropic-workspace-id is required when authenticating with an
identity-linked API key; send the id of the workspace this request acts in."}}
```
## What is wrong
`anthropicClient.ts` constructs the client with an API key and nothing else. That is correct for an ordinary key. An **identity-linked** key — one issued against a workspace rather than standing alone — additionally requires an `anthropic-workspace-id` header naming the workspace the request acts in. There is no way to supply one today, so drafting cannot work with that kind of key at all.
Nothing about the key's *shape* says which kind it is, so this could not have been caught before a real call. #223's task 8 existed precisely to make a real call, and this is what it found.
## Fix
Read `ANTHROPIC_WORKSPACE_ID` and, when set, pass it as a default header on the client. Absent, behave exactly as now — plenty of keys do not need it, and requiring one would break the ordinary case.
Then wire it into both compose files the way the key itself is wired: `QA_ANTHROPIC_WORKSPACE_ID` for QA, `ANTHROPIC_WORKSPACE_ID` for production, both optional with an empty default so an unset variable cannot fail a deploy.
## What is already right and should not change
The failure handling. The submission survived with its photos, the draft recorded `ai_error`, the state went to `failed` after its attempts, and the review queue showed the reason. A model call failing must never lose somebody's consignment, and it did not.
## Worth noting for #227
The budget still has no measured number behind it, because no call has yet succeeded. The first successful draft's `cost_micros` is the figure that should set it.
Found by #223 task 8.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Every draft in QA fails. The error reaches the review queue correctly, which is the design working, but the call never succeeds:
What is wrong
anthropicClient.tsconstructs the client with an API key and nothing else. That is correct for an ordinary key. An identity-linked key — one issued against a workspace rather than standing alone — additionally requires ananthropic-workspace-idheader naming the workspace the request acts in. There is no way to supply one today, so drafting cannot work with that kind of key at all.Nothing about the key's shape says which kind it is, so this could not have been caught before a real call. #223's task 8 existed precisely to make a real call, and this is what it found.
Fix
Read
ANTHROPIC_WORKSPACE_IDand, when set, pass it as a default header on the client. Absent, behave exactly as now — plenty of keys do not need it, and requiring one would break the ordinary case.Then wire it into both compose files the way the key itself is wired:
QA_ANTHROPIC_WORKSPACE_IDfor QA,ANTHROPIC_WORKSPACE_IDfor production, both optional with an empty default so an unset variable cannot fail a deploy.What is already right and should not change
The failure handling. The submission survived with its photos, the draft recorded
ai_error, the state went tofailedafter its attempts, and the review queue showed the reason. A model call failing must never lose somebody's consignment, and it did not.Worth noting for #227
The budget still has no measured number behind it, because no call has yet succeeded. The first successful draft's
cost_microsis the figure that should set it.Found by #223 task 8.