Skip to content

Retry a failed mention relay check before calling it unauthorized - #9102

Open
chessing234 wants to merge 2 commits into
block:mainfrom
chessing234:fix/mention-relay-retry
Open

chessing234 wants to merge 2 commits into
block:mainfrom
chessing234:fix/mention-relay-retry

Conversation

@chessing234

Copy link
Copy Markdown
Contributor

Fixes #9048

A relay read that timed out or dropped was caught and treated as an empty directory, so send-time mention revalidation showed "Could not authorize a mentioned agent" when access had not changed.

The relay read is now tried three times. If it still fails, and a mentioned agent needed that directory, the error says the relay could not be reached. A directory that answers and excludes the agent is still an authorization failure. A managed agent with fresh local evidence is still admitted when the relay read fails.

agentMentionRevalidation.test.mjs: 12 tests passed locally.

Made with Cursor

A dropped relay response was shown as an access failure. Retry the read, and
say when the relay could not be reached.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@chessing234
chessing234 requested a review from a team as a code owner November 5, 2026 07:36
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is d839d3731a11ab363a69e7f5b851c3031b7680dd...09d0e553121a358ace4aeb305578710d80b274cf.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review 09d0e553121a358ace4aeb305578710d80b274cf to authorize a new review.
Any previous review applies only to its recorded range.

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 Blocker: useMentionSendFlow.ts now calls agentMentionFailureMessage(error) in its send-failure catch blocks, but desktop/src/features/messages/ui/useMentionSendFlow.test-support.mjs stubs "@/features/messages/lib/agentMentionRevalidation" with only AgentMentionAuthorizationError. In those tests agentMentionFailureMessage is undefined, so the call throws a TypeError inside the catch and the outer catch shows "Could not send message. Please retry.". That breaks useMentionSendFlow.cancellation.test.mjs ('publication failure remains visible and recoverable after invitation', which expects "Message failed to send: relay rejected publication") and likely the 'send failed' case in useMentionSendFlow.authority.test.mjs. Fix: add agentMentionFailureMessage to that stub, e.g. agentMentionFailureMessage: (error) => (error instanceof AgentMentionAuthorizationError ? error.message : null), keeping the class identity shared. The retry logic itself looks fine; the main desktop test lane has not run on this PR yet, so CI has not caught this.

Signed-off-by: Taksh <takshkothari09@gmail.com>

This branch has not been deployed

No deployments
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.

Desktop: a transient relay query failure during send-time mention revalidation shows "Could not authorize a mentioned agent" (no retry)

2 participants