fix(hitl): normalize clone-pool suffix in agent_id comparison (SMCP-37) - #60
Merged
Conversation
added 2 commits
July 18, 2026 13:22
hitl_pending's agent_id query-param check hard-rejected any non-exact match against the deployed AGENT_ID, even though the code's own comment already called that param advisory. Every scoped-mcp process deploys with a forward-compat numeric suffix (e.g. sysadmin-01), which required matrix-hitl-bot's config to track the exact suffix instead of a stable bare alias. Strip a trailing -\d+ suffix on both sides before comparing, so a bare alias and a suffixed deployed id both resolve — while a genuinely different agent still correctly does not match. Exact-match path is unchanged. agent-id: developer
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> agent-id: developer
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
hitl_pending'sagent_idquery-param check hard-rejected any non-exact match against the deployedAGENT_ID, even though its own comment already calls the param advisory.sysadmin-01), which previously forced matrix-hitl-bot's config to track that exact suffix instead of a stable bare alias.-\d+suffix on both sides before comparing, so a bare alias (sysadmin) and a suffixed deployed id (sysadmin-01) both resolve — while a genuinely different agent still correctly does not match. Exact-match path is unchanged (regression-tested).Companion PR:
matrix-hitl-botfeature/smcp-37-alias-normalization (same fix, client side).Test plan
pytest tests/test_hitl_http.py— 8 passed (5 existing + 3 new: exact-match regression, normalized-suffix match, cross-agent rejection)pytest— 721 passed, 11 skipped (pre-existing, unrelated)ruff checkclean🤖 Co-authored with Claude Sonnet 5