Repository navigation
fix(claude): reject mismatched self and scope ids - #260
bniladridas wants to merge 1 commit into
Conversation
A scoped channel accepted --self without comparing it to the scope frame's agent_person_id, so a wrong value could drop another member's posts and push the agent's own. Fail with exit 2 before binding or handling events when the ids differ; an unscoped stream still uses --self alone. Add regression tests for a matching id that drops the agent's own post and a mismatching id that ends the channel without fetching a message. Refs Vycari#254. Signed-off-by: Niladri Das <125604915+bniladridas@users.noreply.github.com>
Vycari ReviewRound 1 on 832befa. The verdict is the Vycari Review check run, and each open finding is an inline thread. Reply on every P0 and P1 thread: Open: P0 0 · P1 0 · P2 0 · disputed 0 · confirmed fixed 0 · withdrawn 0 Hand-off: Greptile requested on 832befa. No open findings this round. P2s, judge's notes and closed findingsJudge's notes No candidate findings were raised. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@greptileai review |
Human overview
A scoped
agents claude-channelrun now refuses a--selfthat disagrees with the scope frame'sagent_person_id. The mismatch exits 2 and is rejected before the scope is bound or any subsequent message event is handled, so a wrong id cannot drop another member's posts or push the agent's own. Unscoped runs retain their existing--selfandis_youbehavior. Fixes #254, item 3 of 4 follow-ups from #122.AI reviewer
Details for agents: what the diff does, invariants, verification, checklist
What it does
ChannelWorker._accept_scopenow compares a supplied--selfwithseen.agent_person_idusing_same_id(UUID case-insensitive) before settingself.boundor handling events._Ended(2)with a message naming both ids. The channel emits its standardendedcontrol event, but no message is fetched or pushed after the mismatch.--selfis absent,self_idstill comes from the scope frame, and unscoped streams still use--selfor theis_youfallback.Invariants
--selfcan only confirm it.self.bound = seen, so a mismatch does not bind the channel to the scope.Where to look hardest
self.bound, so a changedagent_person_idstill ends the channel._same_idcanonicalizes UUIDs, so case differences are not treated as a mismatch.Verification
uv run --extra dev pytest tests/test_claude_channel.py -q: 135 passed in 21.16s.uv run --extra dev pytest -q: 3344 passed, 2 skipped in 578.78s.uv run --extra dev ruff format --check: 150 files already formatted.uv run --extra dev ruff check: All checks passed.uv run --extra dev ty check src/pepper_cli/: All checks passed.Checklist (repo-specific)
uv run ruff format --checkanduv run ruff checkclean (no new lint ignores)uv run ty check src/pepper_cli/cleanuv run pytestpasses; coverage floor in.claude/maintainerd.jsonnot lowered (pytest passed; coverage not run locally, CI measures it)/api/v1or# MIRROR:changesSKILL.mdupdated if commands or output changed (N/A: no command or output change)help/cli.mdupdated for a new or changed command, or not user-facing because N/A, no new or changed command and the flag syntax is unchangedRefs #254.