Repository navigation
Retry a failed mention relay check before calling it unauthorized - #9102
chessing234 wants to merge 2 commits into
Conversation
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>
🔐 Codex Security Review
|
joahg
left a comment
There was a problem hiding this comment.
🤖 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>
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