Repository navigation
Conversation
|
/ug-review |
| return {} | ||
| return { | ||
| "features.tui_extensions_statusline": True, | ||
| "tui.status_line_provider": {"server": SERVER_NAME, "tool": TOOL_NAME}, |
| thread = state.get("thread", {}) | ||
| model = thread.get("model", {}) |
There was a problem hiding this comment.
what happens if the snapshot has "thread": null or "model": null? .get raises AttributeError, so the read returns -32602 and no footer. can we fall back to {} when the value isn't a dict?
Suggestion:
| thread = state.get("thread", {}) | |
| model = thread.get("model", {}) | |
| thread = state.get("thread") if isinstance(state.get("thread"), dict) else {} | |
| model = thread.get("model") if isinstance(thread.get("model"), dict) else {} |
| statusline_config = codex_statusline.launch_config(codex_version, session_env_path) | ||
| config_io.deep_merge_dict(overlay, statusline_config) |
| binary, | ||
| *provider_args, | ||
| *codex_config_args( | ||
| {key: value for key, value in statusline_config.items() if key != "mcp_servers"} |
|
|
||
| @pytest.mark.parametrize("platform_name", ["posix", "nt"]) | ||
| @pytest.mark.parametrize("first_prompt", [False, True]) | ||
| @pytest.mark.parametrize("codex_version", ["0.169.0", "0.171.0-alpha.11", "0.171.0-alpha.12"]) |
Polly AI ReviewBlocking issues
Security vulnerabilitiesNone identified in the frozen diff. Non-blocking notesNone. ApproachThe native status-line provider and launch-only overrides fit the outcome without another proxy or persistent configuration writes. Reusing the resolved version would avoid the additional cached lookup and the failure above. SummaryDiff size (computed): 11 files; +550 / -9 lines (559 changed text lines); 0 binary files.
Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements. ChangesAdds a session-local MCP footer provider, version-gated launcher wiring, and an optional no-retry controls read. Supporting tests cover rendering, protocol handling, session isolation, and launcher composition; documentation records ownership and rollout requirements. No dependencies or generated assets change. The size is proportional to the protocol, process-boundary, and compatibility coverage. No concrete removable scaffolding or unrelated cleanup was identified. Added source comments are concise. TestsTest-by-test assessmentStatic review only; no PR code was executed. Reported test and lint results were not independently verified. The default-probe-timeout/successful-retry path lacks regression coverage and exposes the blocking issue above.
No test functions or parameterized cases are removed. Relevant existing configuration, metadata, and routing tests were inspected. The trusted checkout lacks Launcher assertions establish configuration composition and unchanged saved bytes for the seeded configuration. They do not establish native consumption of the experimental API. Reported alpha rendering, stable-build compatibility, completed gateway inference, and native Windows behavior remain unverified. No downstream usage-data verification is established or claimed by these component checks. For manual validation, follow ScopeAll changes support the session-local Smart Router footer; no unrelated changes were found. The patch does not install an alpha or raise the minimum version. Stable-build validation and the subsequent minimum-version/upgrade update remain explicit delivery gates in Automated review by Polly · workflow run |
…router-statusline # Conflicts: # tests/README.md # tests/integration/README.md
|
/ug-review |
| "mcp_servers": { | ||
| SERVER_NAME: { | ||
| "command": sys.executable, | ||
| "args": ["-X", "utf8", "-m", __name__], |
There was a problem hiding this comment.
Codex starts this server from the project directory, and -m puts that directory first on sys.path. If a checked-out repo has its own top-level ucode/ package, that code runs on every smart-routed launch. Can we add -P (Python 3.11+) so the working directory isn't put on the import path?
Suggestion:
| "args": ["-X", "utf8", "-m", __name__], | |
| "args": ["-P", "-X", "utf8", "-m", __name__], |
| if model.get("reasoning_level"): | ||
| model_name += " " + model["reasoning_level"] |
Polly AI ReviewBlocking issues
Security vulnerabilitiesNo confirmed vulnerabilities. Native MCP startup timing and working-directory behavior remain unverified. Non-blocking notes
ApproachThe launch-only provider fits the outcome without another proxy or persisted configuration. It reuses the existing MCP override serialization and session-controls reader. Reusing the version resolved by the minimum-version gate would avoid a second, inconsistent version decision. SummaryDiff size (computed): 11 files; +656 / -9 lines (665 changed text lines); 0 binary files.
Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements. ChangesAdds a version-gated MCP footer provider, separates app-server registration from terminal selection, and reads session controls on refresh for ON/OFF/UNKNOWN recovery. Documentation covers configuration ownership, manual validation, and the stable rollout gate. No dependency or generated-file changes are included. The size is broadly justified by rendering, protocol handling, launcher compatibility, and process-isolation coverage. The duplicate saved-config assertion identified above can be removed without losing coverage. TestsTest-by-test assessmentStatic assessment only: no PR code or tests were executed. The reported focused checks, lint/typechecks, recordings, and earlier credentialed runs remain unverified here. Mocked launch assertions and local stdio exchanges do not establish native Codex rendering, gateway routing, or usage attribution. Native Windows UI and the eventual stable build remain unverified.
No test functions or parametrized cases are removed. Relevant existing minimum-version fallback, controls-recovery, session-toggle, and native metadata journeys cover adjacent behavior, but do not protect propagation of the successful fallback version into this new gate. After fixing that propagation, verify the timeout→successful-fallback launch regression. On the intended native build, follow ScopeAll changed paths support the persistent, session-local Smart Router footer or its validation and documentation. No clearly unrelated changes were found. The minimum-version floor remains unchanged; accepting future version strings does not itself establish stable API compatibility. Automated review by Polly · workflow run |
…router-statusline # Conflicts: # src/ucode/agents/codex.py # src/ucode/smart_routing/v2.py # tests/README.md # tests/integration/README.md
| MINIMUM_SMART_ROUTING_CODEX_VERSION = (0, 171, 0) | ||
| MINIMUM_SMART_ROUTING_CODEX_VERSION_TEXT = "0.171.0" |
| else: | ||
| if routing_unavailable: | ||
| ensure_minimum_version( | ||
| "codex", | ||
| lambda: codex_agent.minimum_version_error(smart_routing_enabled=True), | ||
| ) | ||
| routing_unavailable = None |
There was a problem hiding this comment.
Managed routing used to fall back to a warning. Now a dev on Codex 0.164–0.170 who declines the prompt, or whose codex update fails (offline, or no native upgrader), hits a RuntimeError and gets exit 1. So an admin's routing setting blocks the launch, and the dev has no flag to opt out. Can we catch the RuntimeError here and keep the 'Running without smart routing' fallback?
Suggestion:
| else: | |
| if routing_unavailable: | |
| ensure_minimum_version( | |
| "codex", | |
| lambda: codex_agent.minimum_version_error(smart_routing_enabled=True), | |
| ) | |
| routing_unavailable = None | |
| else: | |
| if routing_unavailable: | |
| try: | |
| ensure_minimum_version( | |
| "codex", | |
| lambda: codex_agent.minimum_version_error( | |
| smart_routing_enabled=True | |
| ), | |
| ) | |
| except RuntimeError as exc: | |
| routing_unavailable = str(exc) | |
| else: | |
| routing_unavailable = None |
| statusline_config = codex_statusline.launch_config(session_env_path) | ||
| config_io.deep_merge_dict(overlay, statusline_config) | ||
| config_args = codex_config_args(overlay) |
| version_match = re.search(r"\b(\d+)\.(\d+)\.(\d+)\b", version_output) | ||
| assert version_match is not None, version_output | ||
| routing_supported = tuple(int(part) for part in version_match.groups()) >= (0, 164, 0) | ||
| routing_supported = tuple(int(part) for part in version_match.groups()) >= (0, 171, 0) |
| gate.send("n\r", "decline the required upgrade") | ||
| gate.wait_for(lambda _: gate.ended, "blocked launch to exit") | ||
| gate.child.close() | ||
| assert gate.child.exitstatus != 0 |
| assert result.exit_code == (1 if recovery in {"decline", "managed-default"} else 0), ( | ||
| result.output | ||
| ) |
UG review recommendationRECOMMENDATION: REJECT (request changes) Reasons:
Findings considered: 7 (severities: high: 3, low: 2, medium: 2); see the inline review comments. Advisory only: this recommendation never approves or merges the pull request. The |
Polly AI ReviewBlocking issues
Security vulnerabilitiesNone identified by static review. Non-blocking notesNone. ApproachNative status-line configuration and session-local controls avoid another proxy. Reuse the existing SummaryDiff size (computed): 18 files; +729 / -82 lines (811 changed text lines); 0 binary files.
Shares use additions + deletions, including generated text and lockfiles. Binary files have no line count. Tests include fixtures/helpers under test paths and colocated test/spec files; categories are path-based, not coverage measurements. ChangesThe change adds a persistent Codex routing indicator, session-control recovery, and a newer routing minimum through the existing upgrade flow. Implementation, tests, CI pins, ownership guidance, and documentation contribute to the diff; dependencies and generated assets are unchanged. The size is broadly justified by the rendering, process, and compatibility boundaries. Removing the duplicate CLI upgrade gate would reduce implementation and fix the blocker. TestsTest-by-test assessmentStatic assessment of the checksum-verified frozen snapshot. Both trusted policies were read. No tests were executed. Base/head commit objects were unavailable locally, so changed-line evidence comes from the snapshot and surrounding context from the trusted default-branch checkout. Parameterized cases are grouped only where their purpose and recommendation match.
No test functions were removed. Existing subcommand environment-suppression and lower-level launch-shape tests do not cover managed routing being reconsidered before dispatch. The smallest missing coverage is the public-CLI regression identified above. The target checkout lacks The PR describes native badge transitions, completed file tasks, and concurrent-session isolation; those runs were not independently verified here. Successful router selection remains explicitly unverified after the reported HTTP 400/downstream 422 fallback. Native Windows rendering and downstream usage attribution are also unverified; request headers alone would not establish usage correctness. For human verification after the fix: use Codex 0.170.0 with managed routing enabled and automatic upgrade unset. Confirm ScopeNo clearly unrelated changes were found. The provider, routing minimum, CI pins, tests, and documentation support the stated workflow. The managed gate’s effect on ordinary commands and app-server stdin is a correctness regression within that scope, not separate feature work. Automated review by Polly · workflow run |
…t-router-statusline
…t-router-statusline
…t-router-statusline
Routed Codex terminal sessions now show a persistent Smart Router indicator: a green ON badge or gray OFF badge beside the current model, directory, and remaining context. Installed-skill toggles update it without restarting. Unreadable controls show UNKNOWN and recover on a later refresh.
Stacked on the required Codex upgrade PR; merge that first. Version-floor enforcement, managed upgrade behavior, and CI version pins belong to the base PR. This diff adds the indicator, launch wiring, focused tests, and documentation.
The provider uses launch-only MCP registration and selection, reads session-local controls, and starts Python with
-P. Saved preferences and unrelated MCP registrations remain on disk; UG selects its footer layout for the routed session. The base PR's required-version gate guarantees API availability, so the footer needs no separate version probe.Verified Claude's real behavior: its banner uses green ON and gray OFF badges, and the plain ON/OFF prompt hint remains visible in both states after the temporary banner hides. Codex keeps the corresponding badge in its persistent footer.
Validation
Videos
Both videos render captured PTY output at original timing. Media is on a separate branch and excluded from this source change.
Stable upstream contract. Manual validation and upgrade behavior:
docs/codex-smart-router-statusline.md.Checklist before requesting review
/ug-reviewand address the comments./integration-testand address any failures.