Repository navigation
fix: repair theme polarity artifacts and Codex 0.144 harness contract - #200
Conversation
Picker panels now paint explicit backgrounds on every repaint so rows no longer retain stale terminal polarity after switching between light and dark themes.
QualityMax ReviewVerdict: COMMENT · Confidence: evidence-backed scan Files eligible: 10 · Files reviewed: 10 · Files with findings: 1 · Findings: 1 · Inline cards: 1 Priority findings
Review gates
Important files
Change diagram — Flowflowchart TD
A[Codex CLI Execution] --> B{Process Exits}
B -- Success --> C[Result Returned]
B -- Failure --> D[Capture Stderr in boundedBuffer]
D --> E[classifyCodexDiagnostic]
E -- Known Error --> F[Return Typed Error (e.g., ErrAuthentication)]
E -- Unknown --> G[Return Generic ErrProcess]
Review lifecycleUse the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 1 prior card(s) are stale/resolved on this head. Thread reconciliation resolved 1/1 superseded QualityMax thread(s). Proof legend: VERIFIED independently judged patch · REPRODUCED verified finding · GROUNDED deterministic evidence · MODEL-ONLY model judgment. QualityMax project results are available in the configured project. Receipt · commit |
|
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | gemini-3.1-flash-lite · completed · 10 eligible / 10 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 10 eligible / 10 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5188014024 and overview #5648478213 confirmed |
| 🧪 Repo Tests | ✅ 817/817 passed (go) |
Powered by QualityMax — AI-Powered Test Automation
…ostics Codex 0.144 emits turn.failed events and exits non-zero, so model, auth, and plan-limit outcomes previously surfaced as generic process failures. - Handle turn.failed: a plan-limit keeps its user-facing outcome even though Codex exits non-zero; other diagnostics classify to ErrModelUnavailable / ErrAuthentication without leaking raw stderr - Retain bounded (64KiB) stderr in OSExecutor, reduced to fixed error categories only - Add JSONL fixture replay tests (success, failure, plan-limit) captured from Codex CLI 0.144.5; item.completed/agent_message parsing already existed on main and is exercised by these fixtures - Add credential-free codex-compat CI workflow pinning the CLI flag contract on 0.144.5 and latest
- ErrAuthentication / ErrModelUnavailable from the runner now print a concrete remediation (codex login / model picker) via codexTurnHint, while the sentinel stays wrapped for programmatic handling - Cover both classifications with fake-CLI tests at the agent layer - codex-compat CI: rename steps to state their real scope (flags only) and document the event-schema-drift gap that needs an authenticated smoke test - theme.go: document the accepted preview-time accent-contrast limit
4b029be to
9409682
Compare
|
| original := len(p) | ||
| if len(p) > buffer.remaining { | ||
| p = p[:buffer.remaining] | ||
| } |
There was a problem hiding this comment.
P3 ·
logic· MODEL-ONLY
The Write method in boundedBuffer returns the original length of the input slice even when it truncates the data, violating the io.Writer interface contract which requires returning the number of bytes actually written.
Evidence: codexrunner/runner.go:635
Impact / next step: Update the Write method to return the length of the slice actually written (len(p)) instead of the original length.
Detailed reasoning
- Root cause: The Write method in boundedBuffer returns the original length of the input slice even when it truncates the data, violating the io.Writer interface contract which requires returning the number of bytes actually written.
- Threat model: Review callers that can reach
codexrunner/runner.go:635. - Existing protection: Reported by llm; confidence: high.
- Alternatives considered: Preserve the current interface; prefer the smallest safe change.
- Severity calibration: P3 based on the scanner severity.
Prompt to fix with AI
Fix this logic finding in codexrunner/runner.go:635. Evidence: The Write method in boundedBuffer returns the original length of the input slice even when it truncates the data, violating the io.Writer interface contract which requires returning the number of bytes actually written. Requested outcome: Update the Write method to return the length of the slice actually written (len(p)) instead of the original length.. Preserve existing behavior and add focused coverage.
QualityMax · proof: MODEL-ONLY · served model: gemini-3.1-flash-lite · requested: gemini-3.1-flash-lite
Summary
turn.failedand exits non-zero — previously model/auth/plan-limit outcomes surfaced as generic process failures. Now: plan-limit keeps its user-facing outcome; other diagnostics classify toErrModelUnavailable/ErrAuthenticationvia bounded 64KiB stderr scanned for fixed markers only (no raw diagnostics cross the boundary).item.completed/agent_messageparsing already existed on main; the new fixtures exercise it.codex login/ model picker) throughcodexTurnHint, with sentinels still wrapped for programmatic use.codex-compat.ymlpins the CLI flag contract on 0.144.5 andlatest; steps are named for their real scope and the event-schema-drift gap (needs an authenticated smoke test) is documented in the workflow.Test evidence
New tests: agent-level fake-CLI coverage for both classifications (
TestCodexAgentSurfacedClassifiedFailuresWithHints); fixture replay for success/failure/plan-limit in codexrunner.Known limitations
latestCI leg verifies flags only; JSONL schema drift in future Codex releases requires an authenticated smoke test to catch.