Skip to content

FEAT: schedule in-memory session follow-ups - #73

Merged
merefield merged 17 commits into
mainfrom
feat/session-scheduling
Oct 7, 2026
Merged

merefield merged 17 commits into
mainfrom
feat/session-scheduling

Conversation

@merefield

@merefield merefield commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Why

Make Sessions a more useful place to direct Codex work: prepare a follow-up for later or after quota recovery, steer or queue work during an active turn, and retain enough prompt/reply context to understand what is happening. Scheduling is explicit and structured, without natural-language parsing or a durable background service.

This describes the final changes relative to main, not the sequence of intermediate implementations.

1. Scheduled follow-ups — terminal and writable web

  • Add one in-memory scheduled follow-up per session, triggered by quota recovery, a delay in hours/minutes, or a calendar date and local time. Existing immediate follow-ups remain available.
  • Provide review, edit, delete and separately confirmed Send now actions, with timing/timezone previews, validation and waiting-state explanations.
  • Show TRIGGER SET instead of TURN COMPLETE for an otherwise completed session with a pending trigger. Working and attention-needed states retain priority. The lowest-priority terminal trigger pill and session label open detail; dismissed rows retain access through their trigger pills.
  • Use the same UI-independent scheduling queue for terminal and writable web mode. Read-only web mode cannot create or access scheduled prompts.

2. Active-turn controls and a unified follow-up queue — terminal

  • Allow typing during WORKING in full detail and the selected wide row when space permits. With the composer focused, Enter steers, Tab queues the next message, and Esc requests interruption; when idle, Enter sends an immediate follow-up. State transitions never automatically submit a draft.
  • Add a FOLLOW-UPS panel above the composer or ordinary approval controls, combining Codex-owned native queued messages and Codexometer's scheduled triggers. Quota-threshold reviews remain isolated.
  • Support queue browsing with the mouse or Alt+Q, arrow/Page keys, and edit/delete controls. Native deletion and scheduled Send now require confirmation. Editing or deleting native messages uses their original identity/content and does not recreate messages that have already started.
  • Refresh native queue state while selected, react to queue-change notifications, show acknowledged submissions immediately while reconciling with the server, and disable stale queue actions after failed reads.

3. Clearer live context and retained drafts

  • Show the observed CURRENT TASK and separate LATEST GUIDANCE during a turn; retain the task above the completed reply until the next turn. Compact rows prioritise reply text when space is limited.
  • Display bounded live reply deltas as REPLY // STREAMING, keeping commentary distinct from final-answer text. Completed messages replace partial text; terminal scrolling follows new text only when already at the bottom. Web receives the same live context through its normal refresh.
  • Preserve ordinary terminal composer drafts per session and between wide-row/full-detail views without sending or automatically focusing them. Secret/question answers and in-flight submissions are excluded.
  • Make the short session ID and name prominent in the full-detail border and composer heading, and consolidate working animation near the composer.

4. Responsive, consistent terminal forms

  • Embed scheduling and native queue editing inside the detail pane instead of replacing the dashboard. Scheduling keeps the composer anchored while the form scrolls and follows keyboard focus.
  • Keep dashboard tabs, attention pills and footer controls usable during scheduling; retain unsaved form edits when navigating away. Explicit Back/Esc cancels an edit without changing the saved job.
  • Give controls consistent hover/focus feedback, distinguish selected trigger type from keyboard focus, and derive mouse hit areas from rendered label widths. Remove duplicate focus instructions.
  • Support keyboard field/action navigation, calendar day/week/month movement and numeric time entry. Small panes retain the composer/footer; confirmation is blocked when there is insufficient room to review it.
  • Localise scheduling, queue controls, validation and trigger-status text across all 17 supported languages. Non-English calendars use numeric month/date formats and localised weekdays.
  • Add subtle theme-coloured composer and queue backgrounds. Update the README, intro post and bundled web assets for the resulting behaviour.

5. Reliability, performance and dependency maintenance

  • Guard scheduled dispatch with fresh quota, account identity, coverage of previously observed windows, an authoritative idle capability and pending-review checks. Manual and automatic sends share an atomic claim; edits invalidate older confirmations.
  • Retain uncertain outcomes for inspection without automatic retries. Known local preflight deferrals remain pending, and completed jobs are pruned before accepting new work.
  • Reduce repeated terminal layout/attention calculations and editor state copying, preserving value-model isolation through copy-on-write widget updates. Add performance/regression coverage without removing behaviour checks.
  • Update the frontend source-map-js dependency from 1.2.1 to 1.2.2.

Scope and limitations

  • Scheduling and live controls require supported connected shared app-server capabilities; local-only observations cannot provide them. Active-turn steering/interruption and native queue management are terminal-only in this PR; writable web retains idle follow-ups, approvals/questions and adds scheduling.
  • Codexometer schedules and drafts are memory-only: exiting cancels them. Closing a browser tab does not stop a running web server's schedules. Native queued messages belong to Codex and may survive Codexometer exiting.
  • All reported quota windows must have capacity, which can conservatively wait on a bucket unrelated to the selected model. A predicted reset time alone is not proof of recovery. No reset credits are redeemed automatically.
  • Scheduled work can run late while a session is busy/unavailable or after resume. Selecting quota recovery when quota is already available runs at the next eligible opportunity.
  • Requests use the session's model/reasoning/speed settings at dispatch. No model overrides, recurrence, natural-language time parsing or disk persistence are added. Native queue editing has no backend compare-and-swap guarantee; avoid simultaneous edits from multiple clients.
  • Streaming/task context depends on observed events; missed history is not reconstructed. Existing bounded-text and local completed-message fallbacks remain.

Verification

  • Latest local checks passed: go test ./internal/ui ./internal/i18n -count=1, go vet ./internal/ui ./internal/i18n, and git diff --check.
  • Targeted race tests passed for scheduling, queue editing and form navigation. Regression tests exercise rendered hit areas in all 17 locales, responsive layout, hover, navigation/draft retention and confirmation safety.
  • The PR also adds scheduling/dispatch, native queue/turn API, streaming-context, HTTP and browser regression tests. Full-suite/CI results should be read from the checks on the current head rather than inferred from earlier local runs.
  • Local binary rebuilt for review. No release or version bump in this PR.

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.

Copilot review overview

🟡 Changes recommended

Trigger navigation and several terminal scheduling statuses do not yet match the documented behavior and localization requirements.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds in-memory scheduled follow-ups, active-turn controls, queue management, and richer live session context across terminal and writable web modes.

Changes:

  • Introduces guarded scheduling and native follow-up queues.
  • Adds streaming task/guidance context, draft retention, and responsive terminal forms.
  • Updates localization, tests, embedded web assets, and source-map-js.
File Description
web/​src/​state.svelte.ts Extends web state and control actions.
web/​src/​Sessions.svelte Displays triggers and live context.
web/​package-lock.json Updates source-map-js.
intro-post.md Documents scheduling behavior.
internal/​web/​state.go Projects trigger and streaming state.
internal/​web/​server.go Registers scheduling collection and API.
internal/​web/​schedules.go Implements web scheduling dispatch.
internal/​web/​dist/​index.html References rebuilt frontend assets.
internal/​web/​control.go Adds schedule control requests.
internal/​web/​control_test.go Tests live-context projection.
internal/​ui/​view.go Initializes render geometry caching.
internal/​ui/​monitor.go Adds trigger badges and identities.
internal/​ui/​monitor_turn_test.go Tests active-turn controls.
internal/​ui/​monitor_summary.go Adds trigger attention and layout caching.
internal/​ui/​monitor_stream_test.go Tests streaming context behavior.
internal/​ui/​monitor_schedule_toggle.go Implements scheduler toggle geometry.
internal/​ui/​monitor_schedule_toggle_test.go Tests toggle interaction.
internal/​ui/​monitor_schedule_panel.go Implements saved-trigger actions.
internal/​ui/​monitor_schedule_pane.go Implements responsive schedule pane.
internal/​ui/​monitor_schedule_pane_test.go Tests pane layout and retention.
internal/​ui/​monitor_queue_style_test.go Tests queue styling and geometry.
internal/​ui/​monitor_prompt_test.go Tests composer presentation and drafts.
internal/​ui/​monitor_name_test.go Tests session identity display.
internal/​ui/​monitor_form_controls.go Defines form hit-testing helpers.
internal/​ui/​monitor_form_controls_test.go Tests localized form controls.
internal/​ui/​monitor_efficiency_test.go Covers copy-on-write and caching.
internal/​ui/​monitor_editor.go Makes editors copy-on-write and themed.
internal/​ui/​monitor_detail.go Adds task and guidance sections.
internal/​ui/​monitor_detail_activity.go Integrates queues and schedule controls.
internal/​ui/​monitor_context.go Adds streaming titles and detail routing.
internal/​ui/​monitor_context_modes.go Retains drafts and prioritizes replies.
internal/​ui/​monitor_context_modes_test.go Updates detail-status expectations.
internal/​ui/​model.go Integrates scheduling, queues, and caching.
internal/​ui/​localisation_test.go Exercises localized interaction surfaces.
internal/​schedule/​quota.go Defines quota dispatch guards.
internal/​schedule/​queue.go Implements the in-memory schedule queue.
internal/​schedule/​queue_test.go Tests scheduling safety and concurrency.
internal/​i18n/​locales/​zh-Hans.json Adds Simplified Chinese strings.
internal/​i18n/​locales/​tr.json Adds Turkish strings.
internal/​i18n/​locales/​sv.json Adds Swedish strings.
internal/​i18n/​locales/​ru.json Adds Russian strings.
internal/​i18n/​locales/​pt-PT.json Adds Portuguese strings.
internal/​i18n/​locales/​pt-BR.json Adds Brazilian Portuguese strings.
internal/​i18n/​locales/​nl.json Adds Dutch strings.
internal/​i18n/​locales/​nb.json Adds Norwegian strings.
internal/​i18n/​locales/​ja.json Adds Japanese strings.
internal/​i18n/​locales/​it.json Adds Italian strings.
internal/​i18n/​locales/​fr.json Adds French strings.
internal/​i18n/​locales/​fi.json Adds Finnish strings.
internal/​i18n/​locales/​et.json Adds Estonian strings.
internal/​i18n/​locales/​es.json Adds Spanish strings.
internal/​i18n/​locales/​en-GB.json Defines new localization keys.
internal/​i18n/​locales/​de.json Adds German strings.
internal/​i18n/​locales/​da.json Adds Danish strings.
internal/​codex/​session_turn_unix.go Implements active-turn mutations.
internal/​codex/​session_turn_unix_test.go Tests turn protocol safety.
internal/​codex/​session_stream_test.go Tests streaming event aggregation.
internal/​codex/​session_queue.go Defines native queue APIs.
internal/​codex/​session_queue_unix.go Implements native queue operations.
internal/​codex/​session_queue_unix_test.go Tests queue reads and mutations.
internal/​codex/​session_prompt.go Exposes active-turn capabilities.
internal/​codex/​session_prompt_unix.go Tracks active turn lifecycle.
internal/​codex/​session_context.go Extends session context fields.
internal/​codex/​session_context_test.go Updates context lifecycle coverage.
internal/​codex/​session_context_daemon.go Aggregates tasks and streaming deltas.
internal/​codex/​live_usage.go Retains same-turn task context.
internal/​codex/​daemon_status_unix.go Tracks native queue revisions.
Files not reviewed (1)
  • web/package-lock.json: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/ui/monitor.go Outdated
Comment thread internal/ui/monitor_detail_activity.go
Comment thread internal/ui/monitor_summary.go
Comment thread web/src/Sessions.svelte
@merefield
merefield merged commit 7674ca5 into main Oct 7, 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