Skip to content

feat: close the visible Glass terminal tab - #1906

Merged
mergify[bot] merged 3 commits into
mainfrom
codex/kr-08c-1-close
Oct 25, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
codex/kr-08c-1-close

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Der sichtbare Terminal-Tab lässt sich jetzt in Glass mit Maus und Tastatur schließen.
Bei Worker-Tabs bleibt der Agent unberührt; bei Ad-hoc-Tabs wird nur das bestehende Schließen der zugehörigen Sitzung ausgelöst.
Die Lieferung umfasst nur diesen Teilschritt; unabhängige Reviews und native Abnahmen stehen noch aus.

Report

Plan-ID: KR-08c-1

  • Execution owner: srv-kr-08c-1-close; child 05fc87d2-ba35-4c75-b8df-391589f54216, parent 366c57e2-488c-48c1-9405-90b0cf28fab6 remains open.
  • Base: 78a1c7c1b9e20e0160f9c4dbd6515f6b6ea68333 (merged fix: use Glass controls for shared session restoration #1904; feat(terminal): use design system search controls (KR-08a) #1556 prerequisite also verified merged).
  • Candidate: 3701f90a778faa4c6fc36c20c04d9c00e5a15b9e, branch codex/kr-08c-1-close.
  • Actual model: gpt-6-astra, effort high, read from this worker's native turn_context on 2026-10-25. Supplied dispatcher admission was read, SHA-256 verified and within 60 minutes at actual start. This server did not independently measure provider quota.
  • RAW: 174 added + deleted lines, all six files and tests/PLAN included; no size exception.
  • Native get_goal({}) returned null; no prior goal was completed or replaced. This handover covers only the bounded child objective, not parent acceptance.

Change and boundaries

A shared design Button beside the tablist calls the existing SessionProvider.close only for the visible session. No close control is offered for restore-only content or an empty view. Worker closing detaches the tab without kill/spawn/restart requests. Ad-hoc closing retains the provider's existing best-effort kill_pty semantics.

The route invalidates obsolete lookup/restart tokens and removes the worker hash using its existing manual-selection pattern. It focuses the remaining selected tab, or the empty state's Classic control. A route-local focus guard handles the remaining viewer's asynchronous autofocus; keyboard/pointer input releases that guard. No provider, reducer, Classic, shared component, IPC, mock or native seam changed.

Exactly one dictionary line was added: terminal.closeTab = Tab schließen. Removing that insertion reproduces the original dictionary bytes. The hardcoded baseline and its tests are byte-identical. Existing TerminalRoute tests remain byte-identical before the appended regression cases.

PLAN changes are limited to the new nine-column child row and the two authorized §10.2 status cells: 08b records #1904/78a1c7c1; 08c/08d records prospective close-only delivery. Ad-hoc launch and split remain open. All other PLAN rows/cells are unchanged.

Evidence — 2026-10-25

Heavy phases used python3 .pa/kr08c1/phase_guard.py && <command> in the foreground: load1 < 8, available memory >= 3500 MiB, cargo roots < 2, total heavy roots <= 2, exclusive warm assigned target and one Cargo build job. No detached work, installation or reviewer launch.

Command / observation Exit / result
bash scripts/sync.sh start 0; assigned clean branch at exact base
npm run dev:start-check -- --max-cargo 2 --min-free-gb 3.5 0; quota warning disclosed, supplied admission used
gh run list --branch main --workflow ci --limit 1 --json databaseId,headSha,status,conclusion 0; current base CI run 40176849813 completed successfully, rechecked before push
gh pr list --state open --json number,title,headRefName,isDraft 0; empty before publication
npm run typecheck 0 before verified RED and in final hooks/gates
npm run test:unit -- src/screens/terminal/TerminalRoute.test.tsx -t 'closes only|focuses an honest|discards a pending|hides close' (shell argument uses unescaped regex alternation) 1 on unchanged product base: five failures for missing public Tab schließen action
npm run test:unit -- src/screens/terminal/TerminalRoute.test.tsx -t 'closes only the visible worker' 1 for reproduced late viewer autofocus before its route fix; green in final suite
npm run test:unit -- src/screens/terminal/TerminalRoute.test.tsx src/sessions/SessionProvider.test.tsx src/sessions/sessionReducer.test.ts 0; 50 tests
npm run test:unit -- src/i18n/hardcoded.test.ts 0; 15 tests; also green in full final suite
bash scripts/ci/red-first.sh 0; all five exact named regressions RED on merge-base and GREEN at candidate
python3 .pa/kr08c1/scope-proof.py and git diff --check 0; byte/additivity/file-scope/size/LF-trailer proofs and clean tree
bash scripts/ci/secret-scan.sh + normal git commit -F ... hooks 0 for all three final commits; no bypass
bash scripts/ci/gates.sh lane prepush 0 at candidate in this worktree; 1,736 frontend tests, 2,327 Rust tests passed; 7 existing Rust skips
git push -u origin codex/kr-08c-1-close 0; normal full prepush hook repeated successfully
git ls-remote origin codex/kr-08c-1-close 0; exact candidate 3701f90a778faa4c6fc36c20c04d9c00e5a15b9e

Red tests were committed before the implementation (5dc0d890, strengthened xterm-boundary regression 10d6def5; implementation 3701f90a). The tests mount real App/TerminalRoute/SessionProvider and mock only Tauri/xterm boundaries. They cover worker detach, exactly one ad-hoc kill request, retained output/listeners, empty view/navigation, hidden close during restore, late lookup/restart results and focus. No real OS process termination is asserted.

Preparation failures were corrected before publication: test setup timing and unsupported test-query typing; an unknown PLAN dependency was replaced with the verified predecessor PR reference. The added browser focus check exposed and then verified the route-local autofocus fix. No test was weakened or given new skips/retries/timeouts.

Inspected browser evidence

Existing Playwright web-server configuration and the unchanged real-route Tauri browser mock were used, with temporary ignored capture files only. Exact capture commands, each preceded by the phase guard:

CAPTURE_STAGE=base node_modules/.bin/playwright test --config .pa/kr08c1/capture.config.ts
CAPTURE_STAGE=head node_modules/.bin/playwright test --config .pa/kr08c1/capture.config.ts
node_modules/.bin/playwright test --config .pa/kr08c1/focus.config.ts

All three final commands: exit 0. Input: rich live worker w1, D1 enabled, /#/leitstand/terminal?worker=w1, 1440×900, dark theme, glas variant, motion off. BASE and HEAD use identical input. The terminal text is canned mock output, not a native Cargo run.

Artifacts retained in the worker's ignored .pa/kr08c1/ directory and inspected with view_image:

Artifact Observed state SHA-256
base-live.png Live worker tab before implementation, no close control fbb4f19243348a9c38cd11eb5bf39c4efbac3ed39e74f51cbdf2b745982be638
head-live.png Same live worker with the named sibling close action 724aebac7db501770b96dcab01cff6526f64d8867dfbd35b8d8b68b9664bdb5b
head-closed.png After Tab → Enter: honest empty view, focus ring on Classic control 39c99d1336997b994bc9cd4baaf994242254d3e2b0fd8796f40a5351aa3311bb

The head capture asserts zero kill/spawn/restart commands and cleared worker hash. The additional real-browser test seeds an existing ad-hoc session via Classic, closes the worker, verifies focus on the remaining tab, then verifies deliberate pointer focus into xterm. Its final result is exit 0; the earlier failing focus assertion was exit 1. Root must inspect the artifacts before review-ok; these are browser/mock evidence only.

NICHT ABGEDECKT

  • Linux does not compile/run #[cfg(windows)] tests (run_in_pty, npm_shim, ConPTY, DPAPI), or Windows clippy arms. Windows validation belongs to the merge queue.
  • Seven pre-existing Rust tests remain skipped. No skip/retry/timeout or assertion weakening was added.
  • Prepush is the local lane: the complete browser-smoke suite, frontend production build and workflow gates belong to the Linux lane and were not run here. The explicit browser cases above were run separately.
  • External services (updater endpoint, OmniRoute, mirror) are not validated by these gates.
  • Native worker execution, real OS process end, installed/effective delivery, assistive-technology behavior, complete Glass acceptance and UAT remain unproven. The ad-hoc kill evidence is the mocked IPC request only; existing best-effort errors are unchanged.
  • The lage-jetzt memory mirror was absent; current Git/PR/CI, source and dispatch evidence were used. No AgentsRoom-only API was required or fabricated.
  • Ad-hoc launch (option B / KR-08c), split (option C / KR-08d), KR-08b follow-ups including C2/C3-K2/C4/C5/V1, native V2-ACC1b/UAT and the parent objective remain open. No release, installation, ready transition, labels or queue operation is included.

Review disposition

Review: Stufe A, two non-author families, both bound to head 3701f90 — Anthropic (Claude subagent, observed claude-opus-5-5[1m]): APPROVE; Moonshot (Kimi CLI v2.1.1, self-reported kimi-code/k3): APPROVE. No high or medium finding. Root inspected base-live/head-live/head-closed PNGs (sha256 match the table above) on 2026-10-25 ~09:40Z: named sibling "Tab schließen" action, honest empty state with focus on the Klassisch control after close.

ID Source Sev Finding Disposition (Root)
R1906-C1 Anthropic low focus-after-close flag can outlive the close until the next focus/input event Follow-up
R1906-C2 Anthropic low accessible name does not say which tab is closed (aria-controls/aria-describedby) Follow-up
R1906-C3 Anthropic low no keyboard-activation test for the close button Follow-up
R1906-C4 Anthropic low the "Klassisch" empty-state action now also appears on a fresh empty route Accepted as report item: visible change beyond close, named here; no code change
R1906-C5 Anthropic nit duplicated reset sequence (select vs close) Follow-up
R1906-K1 Kimi low closing the last tab with error set hides the empty state Rejected: the close handler clears error (setError(null), TerminalRoute.tsx:95) before closing
R1906-K2 Kimi low HonestState action prop not in snapshot Rejected: rendered action observed in head-closed.png and asserted in tests
R1906-K3 Kimi low removed .g-terminal > .g-tabs rule No action: no remaining consumer (both reviewers grepped)
R1906-K4 Kimi low late-restart test does not assert hash cleared Follow-up
R1906-K5 Kimi low focus test spies on Terminal.prototype.focus (boundary coupling) Follow-up

Root owns two independent reviews from different non-author families bound to the exact candidate, final acceptance, ready/review-ok and Mergify. Worker delivery is this DRAFT and checked handover only; no reviewer was launched by the worker.

Cuarroc and others added 3 commits October 25, 2026 10:03
Exercise real App sessions through public controls and Tauri boundaries.

Plan-ID: KR-08c-1
Test-First: src/screens/terminal/TerminalRoute.test.tsx::closes only the visible worker tab without stopping workers
Test-First: src/screens/terminal/TerminalRoute.test.tsx::closes only the visible ad hoc session at the PTY boundary
Test-First: src/screens/terminal/TerminalRoute.test.tsx::focuses an honest empty state after closing the last worker tab
Test-First: src/screens/terminal/TerminalRoute.test.tsx::discards a pending worker lookup when the visible tab is closed
Test-First: src/screens/terminal/TerminalRoute.test.tsx::hides close during restore and ignores a late restart after closing a live tab
Co-Authored-By: OpenAI gpt-6-astra <noreply@openai.com>
Model the xterm focus boundary instead of swallowing its focus effect.

Plan-ID: KR-08c-1
Test-First: src/screens/terminal/TerminalRoute.test.tsx::closes only the visible worker tab without stopping workers
Co-Authored-By: OpenAI gpt-6-astra <noreply@openai.com>
Use the existing session close semantics and discard obsolete route results.
Keep focus on the remaining tab or the honest empty-state control, including
late xterm autofocus. Add one close-action translation and bounded plan status.

Plan-ID: KR-08c-1
Test-First: src/screens/terminal/TerminalRoute.test.tsx::closes only the visible worker tab without stopping workers
Test-First: src/screens/terminal/TerminalRoute.test.tsx::closes only the visible ad hoc session at the PTY boundary
Test-First: src/screens/terminal/TerminalRoute.test.tsx::focuses an honest empty state after closing the last worker tab
Test-First: src/screens/terminal/TerminalRoute.test.tsx::discards a pending worker lookup when the visible tab is closed
Test-First: src/screens/terminal/TerminalRoute.test.tsx::hides close during restore and ignores a late restart after closing a live tab
Co-Authored-By: OpenAI gpt-6-astra <noreply@openai.com>
@Cuarroc
Cuarroc marked this pull request as ready for review October 25, 2026 09:41
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-25T09:41:29.725552Z 3701f90 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Cuarroc

Cuarroc commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Root acceptance (INTEGRIEREN) for head 3701f90a778faa4c6fc36c20c04d9c00e5a15b9e:

  • Size 174 lines (+161/-13), files match the KR-08c-1 brief plus the Root-approved additive src/i18n/de.ts key (job174 BLOCKIERT → Root authorization).
  • Red-first: Test-First trailers (path::name) on 5dc0d89, 10d6def, 3701f90; CI red-first pass.
  • Own Plan-ID row KR-08c-1 present in docs/PLAN.md at head.
  • Reviews (Tier A, author family OpenAI/Codex): Anthropic (Claude subagent) APPROVE, Kimi CLI (kimi-code/k3) APPROVE, both bound to 3701f90; disposition table in the PR body; no open high.
  • Screenshots base-live / head-live / head-closed inspected by Root; sha256 match the report.
  • CI on head: gates (linux), gates (windows), linux_1, linux_2, red-first all pass.
  • Codex connector review (author family, advisory): still running at 10:20:35Z, no inline comments on this head. Not counted as independent review; if it posts a finding before merge, Root re-reads it.
  • Mock-only evidence (browser mock); native runtime not covered — stated in NICHT ABGEDECKT.

Setting review-ok bound to 3701f90.

@Cuarroc Cuarroc added the review-ok Pipeline: review disposition complete, no open high finding label Oct 25, 2026
@mergify mergify Bot added the queued label Oct 25, 2026
@mergify mergify Bot mentioned this pull request Oct 25, 2026
30 of 46 tasks
@mergify
mergify Bot merged commit fbde457 into main Oct 25, 2026
25 checks passed
@mergify

mergify Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-25 10:21 UTC · Rule: default · triggered by merge protections
  • ✅ Checks passed · on draft merge queue: checking #1906 on main (78a1c7c) #1907
  • ✅ Merged — 2026-10-25 10:30 UTC · at fbde45754323c4fe0ad79a5182e75d1a2ae32703 · merge

This pull request spent 8 minutes 53 seconds in the queue, including 8 minutes 14 seconds running CI.

Required conditions to merge
  • check-success = gates (linux)
  • check-success = gates (windows)
  • check-success = red-first
  • github-review-approved [🛡 GitHub repository ruleset rule main-pr-required-checks]
  • label != do-not-merge
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/gates (linux)
    • check-neutral = @github-actions/gates (linux)
    • check-skipped = @github-actions/gates (linux)
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/gates (windows)
    • check-neutral = @github-actions/gates (windows)
    • check-skipped = @github-actions/gates (windows)
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-success = @github-actions/red-first
    • check-neutral = @github-actions/red-first
    • check-skipped = @github-actions/red-first
  • any of [🛡 GitHub repository ruleset rule main-pr-required-checks]:
    • check-neutral = @mergify/Mergify Merge Protections
    • check-skipped = @mergify/Mergify Merge Protections
    • check-success = @mergify/Mergify Merge Protections

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-ok Pipeline: review disposition complete, no open high finding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant