Repository navigation
fix-forward #3943 (tsk-4wadcj): agent reply route returns 500 when the channel lookup raises or channel_id is not a string (CodeRabbit Minor, introduced by #3940, untouched by #3943) #3944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ff337a9
Fix agent chat session reply: channel membership and slug collision
jaylfc 17a3a0c
address in-house review findings for tsk-wfkhb2
jaylfc 42256ac
Merge origin/dev into exec/tsk-wfkhb2 (resolve test import conflict, …
jaylfc c77da1d
tsk-bnohyn [OPEN] fix-forward #3940 (tsk-wfkhb2): fail closed on re…
jaylfc 03b6724
fix: return 503 when trace_id lookup fails on self chat reply (tsk-4w…
jaylfc f252262
fix(agent-chat): handle channel lookup errors and invalid channel_id …
jaylfc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ### Fixed | ||
| - Agent chat reply trace_id lookup failures now return 503 instead of falling back to self-DM (tsk-4wadcj) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ### Fixed | ||
| - fail closed on registry errors and unknown channels in the agent reply route |
2 changes: 2 additions & 0 deletions
2
changelog.d/tsk-jreuii-agent-chat-reply-channel-lookup-503.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ### Fixed | ||
| - Agent chat reply route now returns 503 (chat store unavailable) when channel lookup raises, and 400 (invalid channel_id) when channel_id is not a string, instead of unhandled 500 errors. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| ### Fixed | ||
|
|
||
| - Agent chat session reply endpoint now enforces channel membership: a registry agent can only reply in channels where its slug is listed as a member. Requests targeting a foreign channel (via `channel_id` or `trace_id`) return 403 `{"error": "not a member of this channel"}`. | ||
| - Registry agent slug collision prevention: when two active registry agents have canonical IDs that strip to the same slug, only the first-registered agent may use the session; subsequent agents receive 403 `{"error": "handle collides with another registry agent"}`. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔎 Supported by static analysis
Script executed:
Repository: jaylfc/taOS
Length of output: 5393
Script executed:
Repository: jaylfc/taOS
Length of output: 41597
Script executed:
Repository: jaylfc/taOS
Length of output: 24271
Script executed:
Repository: jaylfc/taOS
Length of output: 6489
Document the new reply-route responses and limit retry guidance.
This agent-facing API now returns 400 for an invalid
channel_idand 503 when registry or chat-store lookup raises. Document these responses so clients can handle them correctly. The 400 response is not retryable without changing the request. The lookup-related 503 responses occur beforerecord_reply, so retrying them cannot duplicate that reply.📝 Suggested doc addition
Committable suggestion