Repository navigation
loopguard: pass over rtk's command prefix - #247
Merged
Saksham Uboweja (SakshamUboweja) merged 1 commit intoNov 18, 2026
Merged
Saksham Uboweja (SakshamUboweja) merged 1 commit into
Saksham Uboweja (SakshamUboweja) merged 1 commit into
Conversation
rtk's Codex mode has the agent type `rtk pytest`, `rtk proxy npm test` and `rtk git checkout -- f`. trace.strip_rtk_prefix already removes that prefix for the micro-skill classifier, but the loop guard did not, so a test run behind it was no verification (a failing one after the last edit left the turn green), `rtk git status; pytest` lost its own exit status, and `rtk proxy sed -i` was no edit. turn._PREFIX_RE now passes over trace.RTK_WORDS, the same definition RTK_PREFIX_RE is built from, and shell_edits._bare drops the prefix the way strip_rtk_prefix does. Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
Saksham Uboweja (SakshamUboweja)
merged commit Nov 18, 2026
4b6b4cf
into
microsoft:main
11 checks passed
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.
rtk's Codex mode has the agent type
rtk pytest,rtk proxy npm testandrtk git checkout -- f.trace.strip_rtk_prefixalready takes that prefix off for the micro-skill classifier (andte doctorcalls rtk compatible), but the loop guard read the command as typed:status_of_tests("rtk pytest -q")wasNone, so the run was no verification and a failing one after the last edit leftresolved_proxy()True.rtk git status; pytestlost the run's own exit status, becausertkwas not a quiet head.rtk proxy sed -i ...was no edit andrtk git checkout -- fwas no revert.What changed:
trace/calls.py:RTK_WORDS(rtk, optionallyproxy) is the one definition;RTK_PREFIX_REis built from it and matches exactly what it did before.loopguard/turn.py:_PREFIX_REpasses overRTK_WORDS, only when a command follows, soK=2 rtk pytestandrtk K=2 pytestboth count and a barertkis left alone.loopguard/shell_edits.py:_baredrops the prefix the waystrip_rtk_prefixdoes.Tests in
tests/test_live_core.pycover runs behind the prefix throughTurnGuard.fold, what stays undecided (rtk,rtk proxy,--collect-only,rtk proxy echo pytest, a pipe), and the read/edit/revert cases. 11 of the 16 fail with the source change reverted.Checked with
python -m pytest tests experiments/testson Python 3.10 and 3.13 (1575 passed, 34 skipped on both), andscripts/dead_code.pyshows the same as main. It also merges cleanly with #240, which edits the same regex.Saksham Uboweja (@SakshamUboweja)