Skip to content

FEAT: improve Sessions controls and approval coverage - #102

Merged
merefield merged 8 commits into
mainfrom
feat/sessions-cycle-detail
Nov 8, 2026
Merged

merefield merged 8 commits into
mainfrom
feat/sessions-cycle-detail

Conversation

@merefield

@merefield merefield commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Managed network requests and terminal-input approvals now have dedicated reviews in the terminal and writable browser. These close two more approval gaps without adding an execution engine or policy manager: Codexometer displays the Codex request, returns the user's decision through the existing connection, and leaves execution and enforcement to Codex.

  • Network approvals (c3942f1): review host, protocol and justification; offer only advertised one-time/conversation grants and persistent host allow/block rules. Both persistent choices require confirmation by default. Exact advertised rule payloads are retained, with no widening to another host or wildcard.
  • Terminal-input approvals (5aa8ed5): review the target terminal, start directory, optional environment and exact input as visible escapes. SEND INPUT ONCE and CANCEL INPUT answer the original callback. No reusable stdin grant or parent-command inference is allowed; changed input, terminal or directory invalidates browser preparation.

Extra filesystem/network permission requests, unstable file-root grants, general MCP forms and browser/device authentication still require Codex. Unsupported or incomplete variants stay visible with a handoff. The terminal-input parser follows Codex 0.167's native quoted write_stdin --session-id presentation and never evaluates shell syntax.

MCP/app tool approval requests were ignored by Sessions, so their four-choice consent dialog never reached the interface. The terminal and writable browser now review the server, supplied tool/app identity, message and arguments, then offer APPROVE ONCE, ALLOW FOR SESSION, ALWAYS ALLOW TOOL and CANCEL TOOL CALL. Session/persistent grants appear only when Codex advertises them and require confirmation by default; the launch confirmation policy applies. Omitted argument metadata is shown as unavailable.

The adapter answers the original request using MCP action/content/_meta responses, including the exact advertised persistence scope. Request IDs, fresh one-use capabilities, replay/reconnect protection and prepared browser reviews remain bound to the original approval. Missing turn/item IDs and connector payloads without tool_name are supported. General forms, URL authentication and device verification stay visible for handling in Codex. Protocol shape follows the Codex app-server elicitation documentation; tool-consent metadata was checked against the local Codex source.

Sessions has a single C(Y)CLE control in the terminal and browser. Mixed rows first match the most detailed listed overview row; a uniform list cycles together through graph only → split detail/graph → wide detail → graph only, without opening full-screen Detail.

The selected terminal row receives roughly twice the height of its neighbours when space permits, preserving the three-line minimum and existing page size. The browser allows twice as much reply-text height in its selected row. Selection changes the allocation; hover does not.

Unread completion indicators reflect deliberate reading on supported shared app-servers:

View/action Codexometer marks the latest reply read
Graph or split preview Never, including split scrolling.
Deliberately selected/expanded wide row After three continuous seconds with the actual reply visible.
Explicitly open full-screen Detail Immediately when the latest completed result is visible.
Bulk Cycle, restored layout, hover or newly arriving reply No acknowledgement or automatic timer.

Changing selection, leaving wide mode, hiding the reply, switching away from Sessions or receiving a newer result cancels the dwell. Timers bind the exact session, turn and read revision; stale callbacks cannot complete a newer timer. Full Detail checks the actual reply lines against the terminal's clamped document slice and the browser's reply element against its scrollport. Task/guidance text, source metadata and trailing notices alone cannot acknowledge a result; older history or a different cached text revision cannot acknowledge the latest reply. A reply arriving in an already-open full Detail page still needs a fresh review gesture. Read-only web never sends receipts.

Other layout behaviour:

  • Approval buttons keep a consistent two-cell gap. Confirmation widths stay inside the painted brackets, preserving button positions and matching click targets. Inline approval rendering and fit measurement use the complete 65,536-character review budget for every supported approval family; requests that do not fit retain the route to full Detail.
  • y replaces the Sessions h shortcut. Focused editors, modified browser shortcuts and full Detail retain their controls; reported held-key repeats do not cycle.
  • Cycle includes off-page matching rows and preserves filtered-out/dismissed terminal layouts. Empty lists disable it.
  • Selection and ordinary drafts survive cycling; pending confirmations are cleared.
  • The global three-view default persists across restarts and applies to newly observed sessions. Existing saved hide/show preferences still load; individual row arrows retain their behaviour.
  • Updated all 17 locale labels, README, intro post, embedded browser assets and the real terminal Sessions screenshot.

Validation: Go race suite, all 17 locale surface suites, Go vet, Windows application/UI-test compilation, frontend type/format checks, all 169 browser tests, and all 7 screenshot hashes pass. Deterministic timer tests cover expiry, cancellation, replacement replies, bulk actions and visible reply bounds. Approval-spacing, MCP, network and terminal-input control regressions run across all 17 locales. Synthetic WebSocket tests verify all four MCP response payloads, capability consumption, replay/resolution and rejection of unadvertised grants; changed tool arguments invalidate browser preparation. Network fixtures verify all six decisions and exact allow/deny payloads; stdin fixtures verify quoting, visible control characters, missing-data rejection, one-time responses and independent callbacks on the same parent item. Browser cases cover all three confirmation modes and read-only reviews. Additional regressions cover long inline reviews for all five approval families and full Detail with the reply hidden behind task/guidance or source metadata, including current-turn history and notice-only viewports. The startup-resize test now waits for the asynchronous resized layout instead of reading the old viewport immediately.

The duplication ratchet passes all four scans. Compared with main, normalized 50-token matches fall 142 → 141, duplicated lines fall 1,467 → 1,429 and tokens 10,660 → 10,479. Normalized 100-token matches fall 11 → 10, lines 212 → 192 and tokens 1,928 → 1,828. Both exact scans are unchanged; the baseline is untouched.

Validation uses synthetic Codex/MCP traffic and browser requests; no live connector permission, network rule or terminal input was exercised.

@merefield merefield changed the title FEAT: cycle Sessions overview detail levels FEAT: improve Sessions layouts and deliberate read indicators Nov 7, 2026
@merefield merefield changed the title FEAT: improve Sessions layouts and deliberate read indicators FEAT: improve Sessions controls and support MCP tool approvals Nov 7, 2026
@merefield merefield changed the title FEAT: improve Sessions controls and support MCP tool approvals FEAT: improve Sessions controls and approval coverage Nov 7, 2026
@merefield
merefield requested a balanced review from Copilot November 7, 2026 22:26

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

Approval controls can appear while critical MCP arguments or terminal-input details remain hidden because rendering and fit checks use truncated review context.

3 open issues
What changed in this PR

This PR expands Sessions approval reviews through the existing Codex connection and improves how users navigate and read session results, while leaving execution and policy enforcement to Codex.

Changes:

  • Adds MCP/app-tool, managed-network and terminal-input approval reviews with scoped choices and confirmation handling.
  • Introduces three-view Cycle controls, larger selected rows and deliberate-reading timers for unread replies.
  • Updates regression tests, all 17 locale catalogues, documentation and embedded browser styling.
File Description
web/​tests/​browser.spec.ts Tests cycling, reading timers and approval controls.
web/​src/​style.css Increases selected-row text height.
web/​src/​Sessions.svelte Adds Cycle, reading timers and approval displays.
web/​src/​SessionActions.svelte Renders specialized approval reviews.
web/​src/​preferences.svelte.ts Persists and cycles three overview layouts.
web/​src/​MCPApproval.svelte Displays MCP tool approval details.
web/​src/​contracts.generated.ts Adds approval review contracts.
web/​src/​ActionApproval.svelte Displays structured action approval fields.
README.md Documents controls, approvals and read receipts.
intro-post.md Updates the feature introduction.
internal/​web/​state.go Projects approval details into browser state.
internal/​web/​dist/​index.html References updated embedded assets.
internal/​web/​dist/​assets/​index-Ck-q96h6.css Includes rebuilt selected-row styling.
internal/​web/​control.go Offers specialized approval choices and details.
internal/​web/​control_test.go Tests approval preparation and request binding.
internal/​ui/​preferences.go Persists three-view preferences with legacy compatibility.
internal/​ui/​preferences_test.go Tests layout preference migration.
internal/​ui/​monitor.go Gives selected terminal rows more height.
internal/​ui/​monitor_read.go Adds cancellable wide-row reading timers.
internal/​ui/​monitor_read_test.go Tests receipt timing and cancellation.
internal/​ui/​monitor_prompt_test.go Updates editor-isolation assertions.
internal/​ui/​monitor_navigation.go Replaces Hide/Show with Cycle.
internal/​ui/​monitor_detail.go Renders specialized terminal approval reviews.
internal/​ui/​monitor_detail_activity_test.go Updates hidden-context animation coverage.
internal/​ui/​monitor_copy_test.go Updates copy eligibility tests for layout preferences.
internal/​ui/​monitor_context.go Integrates Cycle labels and input handling.
internal/​ui/​monitor_context_test.go Tests Cycle persistence and click targets.
internal/​ui/​monitor_context_modes.go Implements synchronized overview cycling.
internal/​ui/​monitor_context_modes_test.go Tests cycling, drafts and row allocation.
internal/​ui/​monitor_approval.go Shares approval labels and stabilizes button spacing.
internal/​ui/​monitor_approval_test.go Tests approval choices, confirmation and spacing.
internal/​ui/​model.go Adds layout and reading-timer state.
internal/​ui/​localisation_test.go Runs approval regressions across locales.
internal/​i18n/​locales/​zh-Hans.json Adds Chinese Cycle and approval labels.
internal/​i18n/​locales/​tr.json Adds Turkish Cycle and approval labels.
internal/​i18n/​locales/​sv.json Adds Swedish Cycle and approval labels.
internal/​i18n/​locales/​ru.json Adds Russian Cycle and approval labels.
internal/​i18n/​locales/​pt-PT.json Adds European Portuguese labels.
internal/​i18n/​locales/​pt-BR.json Adds Brazilian Portuguese labels.
internal/​i18n/​locales/​nl.json Adds Dutch Cycle and approval labels.
internal/​i18n/​locales/​nb.json Adds Norwegian Cycle and approval labels.
internal/​i18n/​locales/​ja.json Adds Japanese Cycle and approval labels.
internal/​i18n/​locales/​it.json Adds Italian Cycle and approval labels.
internal/​i18n/​locales/​fr.json Adds French Cycle and approval labels.
internal/​i18n/​locales/​fi.json Adds Finnish Cycle and approval labels.
internal/​i18n/​locales/​et.json Adds Estonian Cycle and approval labels.
internal/​i18n/​locales/​es.json Adds Spanish Cycle and approval labels.
internal/​i18n/​locales/​en-GB.json Adds English Cycle and approval catalogue entries.
internal/​i18n/​locales/​de.json Adds German Cycle and approval labels.
internal/​i18n/​locales/​da.json Adds Danish Cycle and approval labels.
internal/​confirmation/​policy.go Classifies new one-time approval actions.
internal/​confirmation/​policy_test.go Tests confirmation classifications.
internal/​codex/​stdin_approval.go Parses and validates terminal-input approvals.
internal/​codex/​stdin_approval_test.go Tests quoting, rejection and callback independence.
internal/​codex/​session_context.go Carries structured approval details.
internal/​codex/​session_context_daemon.go Routes newly supported approval requests.
internal/​codex/​session_approval_unix.go Sends protocol-specific approval responses.
internal/​codex/​session_approval_unix_test.go Tests response payloads and one-use capabilities.
internal/​codex/​session_approval_test.go Updates unsupported-request expectations.
internal/​codex/​session_167_test.go Tests actionable network-request expiry.
internal/​codex/​network_approval.go Validates destinations and advertised network rules.
internal/​codex/​network_approval_test.go Tests network scope, replay and expiry.
internal/​codex/​mcp_approval.go Adapts MCP consent requests and persistence scopes.
internal/​codex/​mcp_approval_test.go Tests MCP choices, metadata and request resolution.
internal/​codex/​approval_review.go Builds shared structured approval displays.
internal/​codex/​approval_options.go Centralizes approval labels and policy classification.
assets/​screenshots/​manifest.json Updates Sessions screenshot hashes.

Review effort: Balanced

Comment thread internal/codex/mcp_approval.go Resolved
Comment thread internal/ui/monitor_read.go Resolved
Comment thread web/src/Sessions.svelte Resolved
@merefield
merefield merged commit 79f7e8d into main Nov 8, 2026
8 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