From 2835252bb3e9a23589cd76387e137281953a2a4e Mon Sep 17 00:00:00 2001 From: Suriyakumarvijayanayagam Date: Sat, 19 Sep 2026 13:36:45 +0530 Subject: [PATCH] assistant: recognise the API's other wording for a missing workspace id The key-needs-a-workspace error arrived as 'must include the anthropic-workspace-id header' and was reported as a bare 500 instead of 503 assistant_misconfigured naming the variable. Match the header name, not the sentence around it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KGcjxF1cNLcuwc3DAPcnfj --- server/internal/assistant/claude.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/internal/assistant/claude.go b/server/internal/assistant/claude.go index 0cd2210..86f9663 100644 --- a/server/internal/assistant/claude.go +++ b/server/internal/assistant/claude.go @@ -295,7 +295,10 @@ func (c *Client) workspace() string { // a 400 buried in a log, while the user just sees "something went wrong at our // end" - which is true and useless. func NeedsWorkspace(err error) bool { - return err != nil && strings.Contains(err.Error(), "anthropic-workspace-id is required") + // The API has worded this two ways so far: "anthropic-workspace-id is + // required" and "must include the anthropic-workspace-id header". Match + // the header name, which is the part that will not be reworded. + return err != nil && strings.Contains(err.Error(), "anthropic-workspace-id") } func (c *Client) modelID() string {