Repository navigation
fix(agent-toolkit): keep get_user_context on NOT_FOUND errors under intelligence, and log it (5.80.1) - #573
Merged
rami-monday merged 3 commits intoNov 26, 2026
Conversation
…s can't be resolved (5.80.1) relevant_people and relevant_docs can point at users or docs the API no longer resolves. The API then returns the full data with NOT_FOUND errors under intelligence, the client throws, and the whole tool failed, including the notetaker block. Keep the partial data when every error is under intelligence and me is present; rethrow anything else. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rs, and log it Review feedback: any error under intelligence was dropped, so a timeout or permission error there would be hidden too. Now every error must be under intelligence and carry extensions.code NOT_FOUND. When partial data is used, warn through the toolkit logger with the error count and paths, so we can see how often it happens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rami-monday
approved these changes
Nov 26, 2026
rami-monday
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. I checked a staging reproduction: the API returns only User not found errors under intelligence.relevant_people with extensions.code: "NOT_FOUND", so this check matches the real case. The client error shape (response.data / response.errors) matches what graphql-request throws, and the extractors already drop null entries.
A few non-blocking nits inline.
Reuse GraphQLErrorResponse instead of an inline error type, log each path once, say "any NOT_FOUND under intelligence" in the comment and changelog, and cover unresolved relevant_docs in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rami-monday
enabled auto-merge (squash)
November 26, 2026 13:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
get_user_contextno longer fails when anintelligenceentry (relevant_boards,relevant_docsorrelevant_people) points at an item the API can't resolve (deleted or moved). It keeps the partial data, leaves those entries out, and logs a warning.Why
The API returns the full data in that case, plus
NOT_FOUNDerrors underintelligence(for example["intelligence","relevant_people",1,"user"]). The client throws on any GraphQL error, so the whole tool failed, including the user, account, favorites and the newnotetakerblock (5.80.0).Found while testing the Notetaker setup flow on the staging MCP: my staging account fails on every call because of two dead relevant-people entries. It happens in production too, at about 21 "User not found" failures in the gateway logs over the last week.
How
fetchUserContext(), which reads the error through the sharedGraphQLErrorResponsetype. Partial data is used only whenresponse.data.meis present and every error is underintelligenceand hasextensions.code === 'NOT_FOUND'. The existing extractors already drop nulluser/documententries.NOT_FOUND(a timeout or permission error, even underintelligence), an error outsideintelligence, or a response with nome.deps.logger) with the error count and the distinct paths (no user IDs), so we can see how often it happens.🤖 Generated with Claude Code