FEAT: shared quota profile policies for terminal and writable web sessions - #61
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved review-state and verification defects can discard input or report stale and misleading outcomes.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Moves quota threshold profile reviews into terminal session details while preserving native Codex approvals as the highest priority.
Changes:
- Adds per-session quota pills, review controls, and confirmation handling.
- Improves quota-setting verification and diagnostics.
- Updates documentation, tests, and 17 locales.
File summaries
| File | Description |
|---|---|
| README.md | Documents session-based profile reviews. |
| intro-post.md | Introduces the new workflow. |
| internal/ui/view.go | Removes Quota-page profile notice. |
| internal/ui/quota_step_down.go | Refactors per-session quota state. |
| internal/ui/quota_step_down_test.go | Updates quota workflow tests. |
| internal/ui/quota_reset.go | Restores reset-only controls. |
| internal/ui/monitor.go | Surfaces inventory errors. |
| internal/ui/monitor_summary.go | Adds quota attention pills. |
| internal/ui/monitor_prompt.go | Protects composers during reviews. |
| internal/ui/monitor_profile.go | Implements profile review UI. |
| internal/ui/monitor_profile_test.go | Tests profile review behavior. |
| internal/ui/monitor_detail.go | Integrates notices into details. |
| internal/ui/monitor_detail_activity.go | Adds profile control layout. |
| internal/ui/monitor_copy.go | Prevents copying hidden context. |
| internal/ui/monitor_context.go | Routes profile interactions. |
| internal/ui/monitor_context_modes.go | Tracks selected review type. |
| internal/ui/monitor_attention_actions_test.go | Tests stacked attention pills. |
| internal/ui/monitor_approval.go | Keeps profile and approval controls separate. |
| internal/ui/model.go | Handles profile scan and update results. |
| internal/ui/localisation_test.go | Extends localized screen coverage. |
| internal/i18n/locales/zh-Hans.json | Updates Simplified Chinese strings. |
| internal/i18n/locales/tr.json | Updates Turkish strings. |
| internal/i18n/locales/sv.json | Updates Swedish strings. |
| internal/i18n/locales/ru.json | Updates Russian strings. |
| internal/i18n/locales/pt-PT.json | Updates Portuguese strings. |
| internal/i18n/locales/pt-BR.json | Updates Brazilian Portuguese strings. |
| internal/i18n/locales/nl.json | Updates Dutch strings. |
| internal/i18n/locales/nb.json | Updates Norwegian strings. |
| internal/i18n/locales/ja.json | Updates Japanese strings. |
| internal/i18n/locales/it.json | Updates Italian strings. |
| internal/i18n/locales/fr.json | Updates French strings. |
| internal/i18n/locales/fi.json | Updates Finnish strings. |
| internal/i18n/locales/et.json | Updates Estonian strings. |
| internal/i18n/locales/es.json | Updates Spanish strings. |
| internal/i18n/locales/en-GB.json | Updates British English strings. |
| internal/i18n/locales/de.json | Updates German strings. |
| internal/i18n/locales/da.json | Updates Danish strings. |
| internal/codex/session_settings_unix.go | Verifies observed setting updates. |
| internal/codex/session_settings_unix_test.go | Tests notification verification. |
| internal/codex/quota_step.go | Canonicalizes service tiers. |
| internal/codex/quota_step_test.go | Tests explicit default tiers. |
| internal/codex/daemon_status_unix.go | Tracks settings notifications. |
Review details
Suppressed comments (2)
internal/ui/quota_step_down.go:145
- Launching an inventory rescan leaves the existing profile confirmation armed, and the scan-result handler does not clear it either. The previously reviewed settings can therefore remain confirmable across a rescan, contrary to the review binding described by this PR. Disarm the confirmation before starting each scan.
internal/codex/quota_step.go:72 - This canonicalization now treats a nil tier and an explicit
"default"tier as equal, so a standard profile also matches sessions whose reconnect response containsdefault. The README contract still says thatstandardrequires an unset explicit tier, so the documented matching behavior is now inconsistent with this change; update the profile documentation to describe both representations.
return canonicalQuotaSessionTier(s.Tier) == "default"
- Files reviewed: 42/42 changed files
- Comments generated: 6
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Web control concurrency and profile error-state handling still need correction before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
internal/ui/monitor_profile.go:57
- The terminal review displays an implicit default tier as
unset, but an explicit default tier asdefault, while matching treats both as standard speed. It also prints a proposed default tier literally. When the model or effort changes, this can make the review imply a speed change that the write does not make. Use one display helper that renders both implicit and explicit defaults asstandardfor the current and proposed profiles.
- Files reviewed: 57/60 changed files
- Comments generated: 5
- Review effort level: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Automatic retry, notice retention, outcome classification, and composer-preservation issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
web/src/SessionActions.svelte:330
- When SKIP is selected, this confirmation still says the action will be sent to Codex and may start work. The server's skip path only records the threshold as handled and returns without calling
ApplyQuotaProfile, so the warning is inaccurate. Use skip-specific text stating that no Codex settings are changed.
- Files reviewed: 57/60 changed files
- Comments generated: 5
- Review effort level: Balanced
Quota thresholds can now use the existing Sessions command centre for individual profile reviews, or apply a profile automatically when explicitly authorized at launch. Existing command lines default to
askand continue requiring approval for each session.Behaviour
askmode, review one session, then apply and confirm (1, thenC), or skip (2). Controls are clickable and inline buttons appear only when the complete review fits. Navigation and refreshed inventory disarm confirmations; focused or sending composers are preserved.--quota-step-downtoPERCENT:MODEL:EFFORT[:SPEED[:ask|auto]]. The final mode is optional and defaults toask. An empty speed field preserves speed, for example80:gpt-5.6-sol:medium::auto.automode, apply once per eligible loaded session at the active threshold. Process sessions sequentially with fresh inventory and backend verification; new sessions follow the same policy. Already-matching sessions are considered handled. Subsequent manual overrides are respected during that quota window and process lifetime.--web --web-controlfor browser quota policies, includingauto. Read-only launches reject quota-policy flags and have no control endpoints. Browser confirmations bind the current settings, threshold, window and account, and expire after 30 seconds.Validation
go test ./...suite and targeted race tests for quota/profile controls.Available in the terminal and explicitly writable browser mode; shared app-server support for experimental
thread/settings/updateis required. Updates affect subsequent turns, not an already running turn. Concurrent edits in Codex remain subject to the backend's non-atomic settings update behaviour. Automatic browser policies run on the server even with no page open. They require explicit launch-time consent; attempt tracking remains in memory and resets on restart/new quota windows.