Skip to content

fix: preserve project chat drafts across routes (KR-04b) - #1894

Merged
mergify[bot] merged 3 commits into
mainfrom
codex/kr-04b-chat-state
Oct 25, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
codex/kr-04b-chat-state

Conversation

@Cuarroc

@Cuarroc Cuarroc commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Ungesendete Chatentwürfe bleiben innerhalb der laufenden Oberfläche pro Projekt erhalten.
Beim Zurückkehren wird der echte Projektverlauf gelesen, ohne automatisch eine Nachricht zu senden.
Die lokalen Prüfungen sind grün; unabhängige Reviews und Abnahme stehen noch aus.

Report

Plan-ID: KR-04b
Ticket: 54a480e5-5c04-4387-b15b-ae60d7e62e6c
Operator: UMSETZEN. Execution owner: srv-kr-04b-chat-state. Parent: Nutzbar1 / Classic removal; Root owns acceptance, reviews and integration.

Candidate and contract

  • Base: 60aa6ac17afb89cc5f88e220db1f9bf7dbb7d7fb; own clean HEAD, origin/main and remote main matched before edits. Predecessor feat(leitstand): mount orchestrator chat in Verlauf (KR-04a) #1569 was independently confirmed MERGED at 3ad56a8a2c231d5f4d56730a00b26101c6b29d95.
  • Head: babf5f9586b5e12973c1bc998e76e7284b285fd3, branch codex/kr-04b-chat-state.
  • Author: OpenAI gpt-6-astra, effort high, observed in this session's native turn_context at 2026-10-24 23:49:17 UTC.
  • Original 15 October wave-plan/inventory sections 2/7, the current v2 subplan section 10.2, and feat(leitstand): mount orchestrator chat in Verlauf (KR-04a) #1569's deferred draft-lifetime obligation were compared with current source. The bounded contract remains applicable. PLAN updates belong to the coordinator under the dispatch exception.
  • Pre-edit forecast: within 300 raw lines. Actual git diff --numstat 60aa6ac17afb89cc5f88e220db1f9bf7dbb7d7fb: +212 / -36 = 248 raw lines, including tests, five assigned files.
  • Native get_goal({}) initially returned goal: null, remainingTokens: null, completionBudgetReport: null. create_goal returned an active bounded worker goal covering draft/history behavior, allowed files, 300-line limit, predecessor, red-first/gates/push/DRAFT/report acceptance and this owner. The checked handover is its endpoint; parent acceptance is separate. No quota inference from these null fields.

Changes and lifetime

  • Keep one current draft per project in UI-session memory. Route unmounts and project switches preserve text, pending-send state and send errors. Empty idle entries without errors are removed. There is no draft revision history, silent eviction, hard count/text-size cap, or persistence to disk; memory is proportional to outstanding drafts and lasts until this UI document is reloaded/closed.
  • An accepted send clears only its exact submitted project and text revision, including when the user edits away and back to identical text. Refused/failed sends retain the draft and error, including completion while the route is absent. A pending send remains guarded when returning to the route.
  • Reuse the existing orchestrator lookup, backend message reader, 200-message limit and 10-second polling. When a first send completes after route return and the new view still has no orchestrator, repeat the existing lookup. No second history store/poller or navigation-triggered send/start.
  • The shared chat hook adds an optional failure callback; classic callers retain the boolean send contract. Existing controls, keyboard behavior, no-project disabling and scroll handling remain covered by unchanged tests.
  • Architecture drift: gate passed; no new allowlist entry, native seam, schema, routing, design, dependency or policy changes. Source tracing followed ShellMount → VerlaufRoute → VerlaufChat/useOrchestratorChat and the App caller; no project-graph completeness claim.

Evidence

All final evidence is for the head above in the assigned worktree. Commands ran in the foreground, with Cargo slot 2 and one build job; no hook bypass or history rewrite.

Command / stage Exit / observation
bash scripts/sync.sh start 0; assigned clean branch at the pinned base.
npm run dev:start-check -- --max-cargo 2 --min-free-gb 3.5 0 before admission to final build, prepush and push. Additional process/ancestry guards observed load1 7.176 / 6.170 / 7.738 respectively, available RAM above 3,500 MiB, no active heavy roots at those admissions. Slot 1 was observed on the other worker during an earlier check; slot 2 remained assigned here. See procedural deviation below.
npx --no-install vitest run src/shell/mount/verlauf.mount.test.tsx — initial RED 1; six existing tests passed, new draft regression failed because returning to the route erased the draft. Test committed first in 117bdc99.
Same command — first-send RED 1; with draft retention applied, the added first-send case failed because accepted history was never loaded after return. Test committed before the route fix in b15d956f.
npx --no-install vitest run src/shell/mount/verlauf.mount.test.tsx src/screens/leitstand/verlauf/VerlaufChat.test.tsx src/lib/orchestratorChat.test.ts src/lib/orchestratorChat.switch.test.ts 0; 32 tests.
npm run typecheck 0 standalone; also 0 in the final precommit, prepush and normal push hook.
npm run build 0 at the final source/head; frontend production build completed.
bash scripts/ci/red-first.sh 0; both exact regression names missing at merge-base and green at head. The unchanged gate used its authorized existing-lockfile npm-ci in an isolated checkout.
bash scripts/ci/secret-scan.sh 0 before each of the three normal commits; hooks also passed.
bash scripts/ci/gates.sh lane prepush 0; 1,716 frontend tests, 2,327 Rust tests, 33 Denkraum browser tests passed; HQ tests 995 passed and Denkraum Node tests 390 passed.
git push -u origin codex/kr-04b-chat-state 0; normal full prepush hook also passed at the same head, including 1,716 frontend / 2,327 Rust / 33 browser tests.
git ls-remote origin codex/kr-04b-chat-state 0; exact remote SHA babf5f9586b5e12973c1bc998e76e7284b285fd3, observed 2026-10-25 00:08 UTC.
git diff --check / git status --short --branch 0 / 0; clean, tracking the pushed branch.

The new functional proof uses the public ShellMount route and real composer, active-project module, IPC adapters and chat hook. Only Tauri invoke/listen are mocked. This is browser MOCK functional proof in Vitest/jsdom, not native execution or a Chromium chat drill. Literal assertions cover route return, project isolation, fresh backend history, no empty claim at first read, Shift+Enter, no restoration send/start, pending-send protection, identical-text/new-revision survival, late refusal/error preservation, exact accepted clearing and first-conversation discovery. Existing tests were not weakened; no skip, timeout or retry was added.

Procedural deviation

An orchestration mistake started the initial npm run build after the extra load guard had returned 1 (load1 = 10.96875, threshold <8), although the RAM/Cargo startcheck passed. That build completed with exit 0. Subsequent heavy commands were made conditional on both successful checks; a foreground 30-second wait preceded the next admission. The final-head build, full prepush and normal push each had a fresh passing guard. No threshold/configuration was changed. Root must disposition this process deviation; the later green runs do not erase it.

NICHT ABGEDECKT

  • Linux does not compile #[cfg(windows)] tests (run_in_pty, npm_shim, ConPTY, DPAPI) or check Windows clippy branches. The Windows lane remains a merge-queue obligation owned by Root.
  • Existing skips remain: seven Rust, three HQ Node and one Denkraum Node test. No new skips.
  • Prepush is not the full Linux workflow or application browser-smoke lane. Frontend production build was run separately. No chat screenshot/visual, full Glass acceptance, user UAT, native/provider, release or effective-product claim.
  • External services (updater endpoint, provider routing, mirror) were not verified. No real messages or provider workers were started for this package.
  • No browser restart/disk-sync guarantee, draft-size cap or persisted-state policy change. Send/reload error cases are mocked functional evidence.
  • Plan-check ran offline: no GitHub/plan-age comparison or running-job check from that gate. Coordinator owns the agreed PLAN update and final row reconciliation.
  • Project-memory mirror/connector and project graph were unavailable here; only known-source and live Git/GitHub checks are claimed. Provider usage was not independently available; Root must refresh native usage/rules at publication.

Review and handover

Review: ausstehend (Stufe B)

Root arranges two different non-OpenAI review families under current rule 5/E1, dispositions the procedural deviation, and owns acceptance, ready/review-ok and Mergify. This is one checked DRAFT handover: implemented, locally tested, committed and remote-SHA verified; independent reviews, parent acceptance, merge and effective/native operation remain unproven. No follow-on dispatch by this worker.

Review disposition (Root, 2026-10-25 ~00:30Z, head babf5f9586b5e12973c1bc998e76e7284b285fd3)

Tier B (author OpenAI gpt-6-astra). Two reviewers from two different non-author families, both on this exact head: Anthropic (Claude subagent, read-only) — APPROVE WITH CONDITIONS; Moonshot (Kimi CLI, read-only, diff-only) — APPROVE. No high or medium finding.

ID Source Sev Finding Disposition
R1894-C1 / R1894-K2 Claude, Kimi low VerlaufRoute.tsx:23-26 re-lookup also after a failed first send: loading swap, composer focus lost, extra list_workers Follow-up (no push in this PR; run lookup only after an accepted send)
R1894-C2 Claude low possible loading flash after an in-place successful first send (hypothesis, React lanes) Follow-up together with C1
R1894-C3 Claude low retained sending:true never clears if the IPC call never settles (ipc.ts:323-325 has no timeout) Accepted as limit, added to NICHT ABGEDECKT below; follow-up
R1894-C4 Claude low ProjectChat re-renders on each keystroke Follow-up (performance only)
R1894-C5 / R1894-K3 Claude, Kimi low non-retained mode keeps drafts across p1->p2->p1 Rejected: test-only mode, per-project semantics intended
R1894-K1 Kimi low failure reported in both draft.error and chat.error; stale draft error can mask a newer chat error until dismissed Follow-up
R1894-K4 Kimi low module-level draft store without eviction Rejected: bounded by project count, entries deleted when empty/idle (chatDraft.ts:13)
R1894-K5 Kimi low ~80-line monolithic test Rejected: style only, coverage confirmed by both reviewers
PROC-1894-1 Chief process first npm run build started after load guard exit 1 (load1 10.97 > 8) Accepted as one-off deviation; acceptance relies only on the final build/prepush/push runs after passing guards (log: load1 7.18 / 6.17 / 7.74); spec rule guard && phase sent to Stabschef

NICHT ABGEDECKT (Root addendum): if send_to_orchestrator never settles, that project's composer stays on "Sendet …" until the UI reloads (R1894-C3). Evidence is browser MOCK (Tauri invoke/listen mocked); native behaviour not shown.

Cuarroc and others added 3 commits October 25, 2026 01:51
Exercise the real route composer through the mocked Tauri boundary. The regression fails when returning to the route loses the first draft.

Plan-ID: KR-04b
Test-First: src/shell/mount/verlauf.mount.test.tsx::retains project drafts across routes and settles only the submitted revision
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Require genuine history after an in-flight first send completes across navigation. Also observe the empty-state claim at the history read boundary.

Plan-ID: KR-04b
Test-First: src/shell/mount/verlauf.mount.test.tsx::loads the accepted first conversation after returning during its send
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
Keep one current draft and its pending send/error per project in UI-session memory. Clear only the acknowledged text revision and discover a first conversation when a send completes after route return. Reuse the existing history reader and preserve classic callers.

Plan-ID: KR-04b
Test-First: src/shell/mount/verlauf.mount.test.tsx::retains project drafts across routes and settles only the submitted revision
Test-First: src/shell/mount/verlauf.mount.test.tsx::loads the accepted first conversation after returning during its send
Co-Authored-By: GPT-6 Astra <noreply@openai.com>
@Cuarroc
Cuarroc marked this pull request as ready for review October 25, 2026 00:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

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 ✅ Completed 2026-10-25T00:21:35.262106Z babf5f9 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 added the review-ok Pipeline: review disposition complete, no open high finding label Oct 25, 2026
@Cuarroc

Cuarroc commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Root: review-ok set for head babf5f9586b5e12973c1bc998e76e7284b285fd3 (tier B: two non-author families on this head — Anthropic APPROVE WITH CONDITIONS (all low, dispositioned in PR body), Moonshot APPROVE; all required checks green; Codex observer no findings). Any later push voids it.

@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 ae9abb5 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 00:29 UTC · Rule: default · triggered by merge protections
  • ✅ Checks passed · on draft merge queue: checking #1894 on main (60aa6ac) #1895
  • ✅ Merged — 2026-10-25 00:38 UTC · at ae9abb5f0b1388d317f7dfb81dd86e387bebf780 · merge

This pull request spent 8 minutes 39 seconds in the queue, including 8 minutes 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

@mergify
mergify Bot deleted the codex/kr-04b-chat-state branch October 25, 2026 00:38
@mergify mergify Bot removed the queued label Oct 25, 2026
@Cuarroc

Cuarroc commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Report addendum — review evidence limits (Root, 2026-10-25 ~00:42Z, post-merge)

Tier B counted two non-author families for head babf5f9 (author: OpenAI Codex gpt-6-astra/high):

  • Anthropic: Claude subagent inside Root's own harness (claude-opus-5-5), separate agent with its own reads; Root only adjudicated.
  • Moonshot: Kimi CLI v2.1.1 (Kimi Code subscription).

Basis: origin/main AGENTS.md rule 5 + E1 (Elias 2026-10-20: while OpenRouter credit <= 0 a second subscription family may replace OpenRouter). The DOC-mission rule "Root alone uses Claude" (FINAL-20261020T2156Z) is scoped to that docs mission; KR-04b is Glass product work, covered by the "reviews outside this mission: E1" clause.

Evidence gaps, disclosed (not measured after the fact):

  1. The exact Kimi model ID was not logged; the family is inferred from the vendor CLI only.
  2. The E1 condition "OpenRouter credit <= 0" rests on a memory note dated 2026-10-17, not on a fresh observation; usage_overview shows no OpenRouter balance.

Future review starts record the observed reviewer model identity and the E1 condition evidence before counting a review.

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