Skip to content

FEAT: show session failures in a separate Errors category - #90

Merged
merefield merged 5 commits into
mainfrom
feat/session-error-status
Oct 27, 2026
Merged

merefield merged 5 commits into
mainfrom
feat/session-error-status

Conversation

@merefield

Copy link
Copy Markdown
Owner

Why

Codex exposes terminal turn failures, including “Selected model is at capacity”, but Codexometer discarded the error payload. Sessions could retain old context or appear complete/idle without explaining why work stopped. Confirmed failures should also be distinct from the deliberately uncertain CHECK SESSION inactivity warning.

Shared failure handling

  • Add an explicit confirmed-error attention state and bounded, sanitised failure context, shared by terminal and browser modes.
  • Read live error notifications and failed turn/completed payloads, including structured error variants. Restore errors from local plain/compressed rollout history too.
  • Show MODEL BUSY for the server's ServerOverloaded classification, and TURN FAILED for other failures, with the observed message and additional details in session context.
  • Keep transient willRetry errors and non-turn failures (rejected steering/legacy rollback errors) out of ERRORS. No automatic prompt retry, reset or model switch is introduced.
  • Preserve terminal errors across empty completion records. Starting a new turn on the affected thread clears the failure; older identified turn events cannot overwrite a newer turn's context or runtime state.
  • Aggregate linked-agent failures into the existing parent session row, below pending approval/input signals. Closed local writers are not given fresh attention solely because an old failure remains in history.

Sessions presentation and semantics

  • Add ERRORS to the responsive terminal summary, with a clickable/keyboard-navigable filter, amber non-zero count, specific warning badge and clickable attention pill. Keep CHECK* exclusively for inferred inactivity.
  • Order pills Approval → Input → Errors → quota-threshold reviews → Turn Complete → triggers. The browser follows the same priority and displays error totals/details in read-only as well as writable mode.
  • Browser failure labels/lamps and pills use the existing theme warning colour. Stale session data continues to suppress live attention navigation.
  • Reserve INPUT for observed blocking questions/requests. An open locally observed completed turn is TURN COMPLETE, including when no final reply was saved; a confirmed failure is neither INPUT nor successful completion.
  • Exclude failed sessions from the terminal's overlapping Active category. Existing approval, composer and slash-command capabilities still use their original live validation; a display status does not authorise an action.
  • Translate the four new terminal labels in all 17 supported languages; update the English screen snapshot for the additional summary column.
  • Update README and intro-post guidance. Regenerate the embedded frontend with the exact locked dependencies.

Validation

  • Full Go core suite with race detection; all-language screen regressions; go vet and formatting/diff checks.
  • New coverage for live terminal/transient/non-turn errors, late turn events, plain/compressed startup history, incremental recovery, sanitisation/bounds, linked-agent grouping, request priority, input/completion separation, error filter/pill/detail and browser projection.
  • All 96 browser tests pass. New browser coverage checks error counts, pill ordering, detailed capacity messages and live recovery; existing totals expectations include the added category.
  • Focused failure and attention tests execute natively on Windows. Linux and Windows amd64 builds rebuilt for local review.

API reference: Codex app-server turn events and error notifications.

No dependency changes, on-disk failure ledger, version bump or additional network listener.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Plain-file startup can restore an older turn’s failure onto a newer running turn because turn identity is initialised after attention and context restoration.

1 open issue
What changed in this PR

Adds confirmed session failures as a distinct ERRORS category across Codexometer’s terminal and browser interfaces, separate from input requests and inferred inactivity.

Changes:

  • Detect and display failed turns from live events and rollout history, with capacity-specific labels and recovery handling.
  • Add error totals, filters, attention pills, translations and regression coverage.
  • Improve terminal layouts and queued-message editing, and allow confirmed speed changes during active turns.
File Description
web/​tests/​browser.spec.ts Tests failure totals, pill ordering and recovery.
web/​src/​Sessions.svelte Displays error totals, warnings and ordered attention links.
README.md Documents failure states, layouts and speed changes.
intro-post.md Introduces error reporting and updated speed controls.
internal/​web/​state.go Projects failure labels and context to browser state.
internal/​web/​session_failure_test.go Tests browser failure-label projection.
internal/​web/​dist/​index.html References rebuilt frontend assets.
internal/​web/​dist/​assets/​index-DiPYjudz.css Adds regenerated failure styling.
internal/​web/​dist/​assets/​index-Bjr_1drg.css Removes the previous stylesheet bundle.
internal/​ui/​monitor.go Adds failure attention and caps telemetry width.
internal/​ui/​monitor_test.go Expands responsive dismiss-control coverage.
internal/​ui/​monitor_summary.go Adds ERRORS totals and prioritised failure pills.
internal/​ui/​monitor_summary_test.go Updates summary counts and colour expectations.
internal/​ui/​monitor_suggestions_test.go Expands suggestion click-target coverage.
internal/​ui/​monitor_queue.go Sizes queued-message editors to their content.
internal/​ui/​monitor_queue_test.go Tests editor growth, resizing and click targets.
internal/​ui/​monitor_navigation_test.go Expands responsive navigation coverage.
internal/​ui/​monitor_inline_prompt_test.go Tests inline prompts at additional widths.
internal/​ui/​monitor_filter.go Adds Errors filtering and excludes failures from Active.
internal/​ui/​monitor_filter_test.go Updates filter and summary expectations.
internal/​ui/​monitor_failure_test.go Tests failure labels, filters, pills and detail.
internal/​ui/​monitor_copy_test.go Expands copy-control layout coverage.
internal/​ui/​monitor_context.go Displays capacity-specific labels and error headings.
internal/​ui/​monitor_commands.go Preserves public speed aliases in inline menus.
internal/​ui/​monitor_commands_inline.go Resolves public aliases for internal tier paths.
internal/​ui/​monitor_commands_inline_test.go Tests inline speed confirmation during work.
internal/​ui/​monitor_columns_test.go Tests telemetry width caps and target alignment.
internal/​ui/​monitor_approval_warning_test.go Expands approval-warning click coverage.
internal/​ui/​english_snapshot_test.go Updates the presentation snapshot baseline.
internal/​i18n/​locales/​zh-Hans.json Adds Simplified Chinese failure labels.
internal/​i18n/​locales/​tr.json Adds Turkish failure labels.
internal/​i18n/​locales/​sv.json Adds Swedish failure labels.
internal/​i18n/​locales/​ru.json Adds Russian failure labels.
internal/​i18n/​locales/​pt-PT.json Adds European Portuguese failure labels.
internal/​i18n/​locales/​pt-BR.json Adds Brazilian Portuguese failure labels.
internal/​i18n/​locales/​nl.json Adds Dutch failure labels.
internal/​i18n/​locales/​nb.json Adds Norwegian Bokmål failure labels.
internal/​i18n/​locales/​ja.json Adds Japanese failure labels.
internal/​i18n/​locales/​it.json Adds Italian failure labels.
internal/​i18n/​locales/​fr.json Adds French failure labels.
internal/​i18n/​locales/​fi.json Adds Finnish failure labels.
internal/​i18n/​locales/​et.json Adds Estonian failure labels.
internal/​i18n/​locales/​es.json Adds Spanish failure labels.
internal/​i18n/​locales/​en-GB.json Adds English failure labels.
internal/​i18n/​locales/​de.json Adds German failure labels.
internal/​i18n/​locales/​da.json Adds Danish failure labels.
internal/​codex/​session_prompt_unix.go Rejects stale turn-completion lifecycle events.
internal/​codex/​session_failure.go Parses, sanitises and classifies shared failure context.
internal/​codex/​session_failure_test.go Covers failure detection, recovery and grouping.
internal/​codex/​session_context.go Restores local failure context with turn checks.
internal/​codex/​session_context_daemon.go Handles live failures and guards turn identity.
internal/​codex/​session_commands_unix.go Allows validated speed-only changes during turns.
internal/​codex/​session_commands_unix_test.go Tests active-turn speed updates and verification.
internal/​codex/​session_approval_unix_test.go Tests stale completion rejection and failure status.
internal/​codex/​live_usage.go Integrates failure attention and completion semantics.
internal/​codex/​live_usage_test.go Separates completed turns from input requests.
internal/​codex/​live_usage_compressed.go Applies turn-aware attention restoration.
internal/​codex/​daemon_status.go Adds a failed runtime status.
internal/​codex/​daemon_status_unix.go Projects retained failures into runtime status.
docs/​slash-command-support.md Documents immediate speed updates and public aliases.

Review effort: Balanced

Comment thread internal/codex/live_usage.go
@merefield
merefield merged commit 9ef6879 into main Oct 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants