Skip to content

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 into
mondaycom:masterfrom
ritikag2209:fix/get-user-context-partial-intelligence-errors
Nov 26, 2026
Merged

rami-monday merged 3 commits into
mondaycom:masterfrom
ritikag2209:fix/get-user-context-partial-intelligence-errors

Conversation

@ritikag2209

@ritikag2209 ritikag2209 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What

get_user_context no longer fails when an intelligence entry (relevant_boards, relevant_docs or relevant_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_FOUND errors under intelligence (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 new notetaker block (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

  • The main query is wrapped in fetchUserContext(), which reads the error through the shared GraphQLErrorResponse type. Partial data is used only when response.data.me is present and every error is under intelligence and has extensions.code === 'NOT_FOUND'. The existing extractors already drop null user / document entries.
  • Anything else still fails as before: an error without NOT_FOUND (a timeout or permission error, even under intelligence), an error outside intelligence, or a response with no me.
  • When partial data is used, it warns through the toolkit logger (deps.logger) with the error count and the distinct paths (no user IDs), so we can see how often it happens.
  • Tests cover the kept cases for unresolved people and docs (including the log) and each failing case. Bumped to 5.80.1 with a changelog entry.

🤖 Generated with Claude Code

ritikag2209 and others added 2 commits November 26, 2026 12:40
…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>
@ritikag2209 ritikag2209 changed the title fix(agent-toolkit): keep get_user_context when relevant people or docs can't be resolved (5.80.1) fix(agent-toolkit): keep get_user_context on NOT_FOUND errors under intelligence, and log it (5.80.1) Nov 26, 2026

@rami-monday rami-monday left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
rami-monday enabled auto-merge (squash) November 26, 2026 13:10
@rami-monday
rami-monday merged commit 15632b2 into mondaycom:master Nov 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants