Skip to content

FEAT: read-only web Sessions command centre and quota trails - #51

Merged
merefield merged 4 commits into
mainfrom
feat/web-readonly-command-centre
Sep 11, 2026
Merged

FEAT: read-only web Sessions command centre and quota trails#51
merefield merged 4 commits into
mainfrom
feat/web-readonly-command-centre

Conversation

@merefield

@merefield merefield commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Why

Build on the merged experimental web interface with a more useful read-only Sessions command centre and a record of observed quota movement, before introducing any browser actions. Keep terminal behaviour and the existing security boundary unchanged.

Included

  • Session totals: compact observed-token/listed-session totals and separate working, approval, input and inferred-check counts. Parent token counters are summed once without adding linked agents or activity samples again. Stale totals are labelled last-known; live state counts become unavailable. The sum reflects the current list and can decrease when sessions disappear.
  • Consumption Zone trails: server-memory observations per quota window, first-observation marker and live path. Browser reloads/navigation do not erase the trail. Changed account/reset/duration, decreased consumption, backwards time or removed windows start fresh. Failed reads introduce a gap. Bounded to the start plus the latest 719 points; discarded intervals are not bridged.
  • Sessions navigation: per-row graph-only, split detail/graph, wide detail and full-page detail. Up/down selects; left/right changes detail; clickable controls mirror navigation. Escape/back returns to wide detail. Global show/hide toggles split versus graph-only. Telemetry columns stay aligned; narrow screens stack panels.
  • Attention visibility: prominent links to waiting sessions, persistent approval-detail indicators outside scrollable text, commands separated from justification, explicit unavailable-command messages. Observed input/approval signals remain distinct from inferred CHECK SESSION inactivity and informational TURN COMPLETE. Failed/disconnected observations are labelled stale and do not keep live attention badges.
  • Browser preferences: retain theme, primary tab, quota view, selection and up to 100 session layouts. Explicit deep links win; fresh pairing restores the primary tab, not an old full-page detail. Validate stored values and tolerate blocked storage. The title remains a shortcut to Quota/Bars.
  • README and intro post describe controls, persistence, limits and the read-only boundary. Generated production assets included; standalone Go distribution unchanged.

Boundaries and caveats

  • No approval, prompt, benchmark or reset mutation endpoints added. Existing authentication, origin checks, SSE authorization and terminal/web launch isolation remain unchanged.
  • No terminal UI, Codex reader, Go dependency or npm dependency changes. No additional listeners/collectors run without --web.
  • Trails show quota-window observations, not per-session attributed consumption or historical reconstruction; retained only until server exit. Account separation uses the existing reader's account identity. Gaps and bounded retention are disclosed.
  • Context source is not used to claim authoritative provenance for a grouped session's status; existing daemon/fallback limitations apply.
  • Preferences are origin-scoped: a fixed --web-port is needed to reliably retain them across launches. Stored layout/selection IDs are documented; replies, commands, trails and Codex credentials are not stored in localStorage.
  • Web remains experimental, read-only and UK-English-only. Native platform/browser validation remains useful.

Validation

  • make -j4 web-test: production frontend check/build, embedded Go build and all 20 Playwright tests passed (18 browser + 2 calendar), including aggregate totals, agent double-count prevention, live updates, disappearing sessions, stale/empty lists, narrow-screen layout, global detail controls for 105 sessions, keyboard-accessible trail tables and browser Back from every full-detail entry control.
  • New browser regressions cover all detail levels, keyboard/mouse selection, consistent telemetry widths, persisted preferences, blocked/invalid storage, live attention transitions, missing commands, stale state, removed selections, trail start/gaps/updates, reload and navigation. Existing security, accessibility and responsive tests retained.
  • go test -race -cover ./... passed (web coverage 95.3%). Additional uncached web/launch tests passed; new tests cover trail bounds, reset/duration/counter/time changes, account changes, failed reads and removed windows. Review regressions cover identically labelled limits and windows, renamed labels, primary-window removal and server-only identity disclosure prevention.

Review fixes

Commit fd1a0b8 addresses all four initial review findings: server-only LimitID/kind/primary-secondary trail identity, global detail defaults independent of the 100-entry per-session history, approval-specific instructions and singular observation captions. Global show/hide clears overrides and also sets the default for newly observed sessions; documented and tested.

Commit 86e45ac addresses the follow-up review: an expandable accessible observation table exposes timestamps, consumption, elapsed time and gaps; central full-detail route entry records the selected wide row so browser Back matches Escape/All Sessions regardless of entry control.

  • Uncached terminal English snapshots, session navigation and compact Fuel Tank regression tests passed under -race; go vet ./... passed.
  • Local production binary rebuilt. No version bump/release in this feature PR.

Try it

./codexometer --web --demo --web-port 8765
# Or with your existing local/shared-daemon Codex observations:
./codexometer --web --web-port 8765

Open the private pairing URL printed by the process. Try Quota → Consumption Zone and Sessions → row arrow controls. Let quota polling run to grow a trail. Stop the process before launching the other command on the same port.

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

Trail identity can mix distinct quota windows, and session controls contain incorrect or incomplete behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds read-only session navigation, persistent browser preferences, and server-memory quota trails.

Changes:

  • Introduces bounded quota observation trails.
  • Expands session detail, selection, attention, and responsive navigation.
  • Persists validated browser preferences and updates documentation/tests.
File summaries
File Description
web/tests/browser.spec.ts Adds browser regression coverage.
web/src/style.css Adds session layouts and attention styling.
web/src/state.svelte.ts Adds trails and restored landing routes.
web/src/Sessions.svelte Implements session command-centre navigation.
web/src/Quota.svelte Connects persisted views and trails.
web/src/preferences.svelte.ts Adds validated preference persistence.
web/src/ConsumptionZone.svelte Renders quota trails and gaps.
web/src/App.svelte Tracks primary-tab preferences.
README.md Documents behavior and boundaries.
intro-post.md Summarizes new web features.
internal/web/zone_test.go Tests trail lifecycle and bounds.
internal/web/state.go Collects in-memory quota trails.
internal/web/dist/index.html References rebuilt assets.
internal/web/dist/assets/index-DvsGTQlj.css Removes obsolete stylesheet.
internal/web/dist/assets/index-CNZdZr3a.css Adds rebuilt stylesheet.
internal/web/dist/assets/index-C0ckR7Cr.js Adds rebuilt application bundle.
internal/web/dist/assets/index-BsZ4bZdB.js Removes obsolete application bundle.
Review details
  • Files reviewed: 12/17 changed files
  • Comments generated: 4
  • Review effort level: Balanced

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

Comment thread internal/web/state.go Outdated
Comment thread web/src/Sessions.svelte Outdated
Comment thread web/src/Sessions.svelte Outdated
Comment thread web/src/ConsumptionZone.svelte Outdated

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

Full-detail links violate the documented Back behavior, and quota trails lack an equivalent accessible representation.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

web/src/Sessions.svelte:257

  • Browser Back does not return this session to wide detail as promised: this link enters full-page detail without changing a graph-only or split layout, so going back restores the old level. Set level 2 before navigating, as the Escape and “ALL SESSIONS” paths already do.
        <a
          class="button"
          href={'#/sessions/' + encodeURIComponent(session.id)}
          onclick={() => select(session.id)}>FULL DETAIL →</a

web/src/Sessions.svelte:275

  • This approval link can be opened from split detail, but it does not promote the row to wide detail first. Consequently browser Back returns to split detail rather than the documented wide detail state; update the layout in the click handler before navigation.
            {#if !stale && session.status === 'APPROVAL NEEDED'}<a
                class="attention-badge"
                href={'#/sessions/' + encodeURIComponent(session.id)}
                >APPROVAL IN CODEX ↗</a
  • Files reviewed: 12/17 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread web/src/ConsumptionZone.svelte
Comment thread web/src/Sessions.svelte

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.

🟢 Approval recommended

The implementation matches the stated read-only boundaries and is supported by focused backend and browser regressions.

Review details
  • Files reviewed: 12/17 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@merefield
merefield merged commit 56e1551 into main Sep 11, 2026
5 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