feat(mode): emit routing status as JSON - #3657
Open
tang-vu wants to merge 1 commit into
Open
Conversation
This was referenced Sep 1, 2026
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
mode-switch.sh --status --jsonfor a stable routing-mode receiptWhy this matters
mode-switch.sh --statusis the documented read-only backend used before changing local, cloud, or hybrid routing. Automation can now determine the active source of truth without scraping colored prose or mutating.env.Overlap check
Searched open and closed PRs for
mode status jsonand PRs referencingods/scripts/mode-switch.sh. Open PR #2626 adds switch previews, while #2616/#2767/#2864/#3076 change atomic writes; none adds a machine-readable status boundary. This PR changes only status reporting and its regression test.Test plan
bash ods/tests/test-mode-switch-status.sh(26 assertions)bash -n ods/scripts/mode-switch.shgit diff --check -- ods/scripts/mode-switch.sh ods/tests/test-mode-switch-status.shTradeoffs and rollback
JSON mode uses the Python runtime already required by ODS to guarantee correct escaping. Removing the new optional flag fully restores the prior interface; switching semantics and
.envwrites are unchanged.Generated with Codex
Batch compatibility
upstream/main@6ff9b4fc; synthetic integration head:e45e2647.make lint, andgit diff --check upstream/main...HEADpassed.tests/test-installer-context-parity.shstill fails atHermes template bounds each model turn; the identical failure was reproduced on the exact upstream base, so it is not introduced by this batch.