Skip to content

feat(templates): add directly into an editable pending chat - #196395

Merged
Patrick-Erichsen merged 33 commits into
mainfrom
template-chat-first-ui
Nov 10, 2026
Merged

Patrick-Erichsen merged 33 commits into
mainfrom
template-chat-first-ui

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Catalog Add detours through details and waits for installation before opening chat. A later failure can also strand an earlier draft when another agent is created.

User Impact

Add from a Template card and start drafting immediately. The same draft survives durable admission, creation of another agent and later setup failure. Explicit Retry setup reuses the original source, plan, consent and canonical session. Required reviews still precede apply; clicking the card itself still opens details.

Backend dependency #196392 landed as caa978caae7a6a31370d1501bd35f16710bd9c1c. This UI PR now targets main. Landing is authorized after applicable review and CI qualification. Manual deployment/release is excluded. The direct catalog entry point incorporates #193117 with the newer chat-first flow.

Why This Change Was Made

The application owns pending creation after the catalog closes, through the existing session-scoped composer and background registry, not a parallel ledger. Admission is tied to the exact request/canonical session independently of roster refresh. Duplicate/stale consent cannot start another apply after navigation, disconnect or Labs disposal. Installer cards render recorded outcomes and offer no duplicate installation action. Existing preview/feedback, overview, skeleton and alerts remain.

  • Admitted A survives creation of B, A failure in the background, and return to A, retaining draft, queued input and accessible explicit Retry without prematurely leaving B.
  • Settled partial recovery retires with its scoped composer on Gateway identity/credential changes, including displaced background creations. Identity-guarded routing cleanup preserves a newer foreground receipt. Captured stale Retry cannot issue apply, chat.send or sessions.create.
  • Main integration preserves direct package detail loading without catalog-search dependency and optional version pinning. Review and Add use the resolved release. Direct card Add and required consent still use the existing request and application owners.

Evidence

  • Cross-chat recovery failed before repair and passed afterward: draft/queued-input preservation, no retry before click, identical retry args, success-only transfer, zero chat.send/sessions.create. Earlier affected batch: 32 passed across three files.
  • Scope retirement failed before repair; foreground/background cases pass afterward. Earlier scope/admission/composer/submission consumers: 26 passed across four files.
  • Main integration: six affected discovery/Add/admission/pending-route/composer/submission suites passed 86 tests. Overlapping plan coverage was then consolidated into the pinned/unpinned independent-detail test; the two changed suites passed all 47 tests afterward. The other four suites' inputs are unchanged. Solid STRICT_READ_UNTRACKED diagnostics remain in passing output; this is not diagnostic-free.
  • UI typecheck and six-file type-aware lint passed; formatting and diff checks passed. UI allocation remains 888, shared scalar unchanged. Combined ratchet against pinned main 3c49dfc: 6,639,890 LF lines / 6,639,891 ceiling / 1 slack. No allowance was increased to absorb main or integration debt.
  • Current head: 0dac669feb9c6ba155686fba0d51c08f5986ed6c, incorporating the landed backend and current main. The preceding main-integration commit d69f74eaeb33 resolved only the shared reader add/add conflict by preserving the reviewed UI reader. Its 39-file patch against landed main is byte-for-byte identical to the prior reviewed UI patch (SHA-256 d1d25ea0116b475cd87e8d259a4ca69f276b4ad392194026eb4f6c68e77f019c). Independent integration review passed; Production UI source/config/lock/toolchain inputs are unchanged; the subsequent fixture-only cleanup is validated below. Follow-up commits repair the catalog fixture channel type and reduce ordinary Chat boot by deferring receipt grouping and creation completion into existing lazy owners. No bundle budget or test allowance was increased.
  • Main-targeted CI at d69f74eaeb33 exposed a test-line overrun: total6,641,400 / ceiling6,641,398. The only follow-up reuses the identical initial route location in the detail fixture, removing eight duplicate setup lines without deleting assertions. All47 affected consumers, scoped type-aware lint, formatting and independent review pass. Official ratchet after the following routing fixture repair is total6,641,394 / ceiling6,641,398 (4slack); allowance888 and shared scalar unchanged.
  • That prior CI attempt also reported a WebKit confirmation-dialog resize-order assertion and a Chromium sidebar archive transition assertion. No matching scheduled-main failure is established. Both Chromium fixtures (6tests) and the exact WebKit confirmation fixture (4tests) pass in isolated local replay; that does not establish a fix or inherited classification. These fixtures and relevant product owners are unchanged, and source inspection finds no matching .shell ancestor for this PR's changed transition selectors. Both browser assertions passed in subsequent CI42916287733/a1 at09d2601; this does not establish their original cause. That run passed8436other tests and all753WebKit tests but failed the first plugin-routing render and exceeded the job deadline; it is not green.
  • Plugin-routing fixture repair at0dac669: await the real lazy settings/detail modules in beforeAll, matching the existing generations suite. A temporary1500ms catalog-detail load reproduced the exact missing-heading assertion; awaiting modules before tests passed all35cases with that delay. Temporary instrumentation was removed; final35cases, type-aware lint, formatting, diff checks and independent review pass. Assertions, timeouts and product code are unchanged. This stabilizes the demonstrated fixture mechanism; it does not classify the original CI failure as inherited or prove that timing was its only cause. Exact new-head CI42920696722/a1 completed successfully, including the full UI suite and WebKit. The accepted old-head auto request was natively retired before this push.
  • Before repair, CI rejected the fixture type and measured Chat boot at 1,301,453 bytes against a 1,301,131-byte cap. After repair, the official fixed-identity static comparator measures 1,300,949 bytes (182 bytes below cap), paired base 1,300,692 bytes, new-agent boot 803,156 bytes, with zero budget violations. This is a bundle-size check, not repeated latency or live product proof.
  • Repair validation: 35 creation/recovery/capability/Template admission tests and five receipt tests passed; full UI types and scoped type-aware lint passed on final source. Required and optional receipt fields remain validated at the trust boundary; malformed optional metadata rejects the entire unshipped receipt. Independent source review found no actionable correctness issue.
  • ClawSweeper's completed review at repair head c5f7bb923d2b7a23a07db25eedbd5cf63d6d3fdd found zero actionable findings. The main integration is patch-identical and independently reviewed; it does not add a new product change. Hosted review is review-only because repair/merge lanes are retired. Independent reviews also pass both subsequent fixture-only repairs. Exact-head CI42920696722/a1 at0dac669feb9 passed with no failed or cancelled jobs; native UI landing qualification follows. Backend is merged.
  • Backend PR records interrupted-checkpoint recovery proof, inherited-failure attribution limits and offline populated latest-stable 2026.11.3 upgrade proof.
  • Existing production-bundled browser proof is retained: five candidate cases at 400/820/1280px and prepared review/retry; three baseline cases. No contentless transition, draft retained, zero chat.send. This predates recovery repairs and main reconciliation; no repeated live Add/visual proof is claimed. Synthetic external Gateway I/O, not a live provider/model. Full real-Gateway A/B/failure/retry/scope journey remains unproved.
  • Baseline images use a private source copy reverting only the card handler, not a whole historical checkout. Historical accepted timings remain composer editable 450.8 ms and durable admission 3356.8 ms; no new performance claim. No live Gateway configuration/restart, provisioning, installation or manual deployment.

Before: card Add stops at details

Before: card Add stops at details

After: editable pending chat

After: editable pending chat retains typed draft

After admission: same draft retained

After admission: canonical chat retains the draft

Mobile comparison

Mobile before: detail detour

Mobile after: draft retained in canonical chat

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 10, 2026
@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: stale review; fresh review needed.

Summary
The latest durable ClawSweeper review was for head d69f74eaeb33f02bd6f9805d0e51250950c7eb0b, but the PR head is now 09d2601b1cf7d23dfdb3a1ff8506a407fdb5a755. Its old verdict and PR readiness labels are no longer current.

Next step
Comment @clawsweeper re-review when the current head is ready; pushes after the first review are not reviewed automatically.

Review history (7 earlier review cycles)
  • reviewed 2026-11-10T03:05:06.524Z sha f57aa6f :: blocked before merge. :: [P2] Keep initializing drafts addressable after another creation | [P2] Provide the agent owner in the Templates route fixture | [P2] Update pending-route tests for asynchronous preloading | [P2] Align reduced-motion coverage with the remaining transition
  • reviewed 2026-11-10T05:00:31.596Z sha 36ece6b :: blocked before merge. :: [P2] Keep initializing chats addressable after a subsequent creation
  • reviewed 2026-11-10T19:35:06.443Z sha 11adccf :: needs changes before merge. :: [P2] Retire retained creation metadata when its Gateway scope changes
  • reviewed 2026-11-10T20:09:37.135Z sha ee33a12 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-10T21:23:33.116Z sha d993726 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-10T22:17:35.666Z sha c5f7bb9 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-10T22:27:07.624Z sha d69f74e :: needs maintainer review before merge. :: none

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 10, 2026
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Follow-up at cce79791e2df3ce299743c94f2d4a598691a3ad9 (propagated UI tip 58c010a002b2f06f7a846d78caeaad11c6c66127): derive the test checkpoint type from StatelessTemplateAddOptions["onAgentConfigured"] instead of importing a now-private production type. No production code or test assertions changed.

  • Before: exact-head Templates test graph failed TS2459, and lint reported the resulting error-type unions. After: the Templates graph typecheck, scoped type-aware lint, formatting, diff checks and staged test-line gate passed locally. Exact net backend allocation is now 2,346 LF lines (85 existing + 2,261 admission); shared scalar unchanged. Local combined stack retains 32 lines slack. Published UI tree equals the tested delivery tree.
  • The repaired real-Gateway greeting/authority fixture DID execute successfully in isolated CI on 9e4ba748996aac8581acd7dc045aa162009aba87: 1 test passed in 17.429s, job log. That job is red because of its separate inherited clone-identity test; the fixture result is not a green-job claim and does not establish retained-retry coverage. Latest head changes only test type wiring/allocation.
  • Every remaining final dead-export finding reproduces on clean baseline 9ccdad09a9dfb6a68d32aae18a1014b753ba1704: candidate-only findings = zero. The newly observed sessions.fork participation-code assertion mismatch also reproduces on that exact clean baseline. Existing visible-spawn/clone-identity evidence is retained; none is relabeled green.
  • Prior backend CI test-line ratchet reported 11 lines over the inherited merge-tree ceiling with the exact +2,343 task growth already allocated. This remains a qualified ratchet failure, not a reason to silently raise the shared scalar.

The latest review still leaves substantive recovery work: runtime-fact validation on retained retry, reconciliation of installer-owned partial instruction writes, restart-persistent bootstrap custody, preserving ordinary agents.create immediate greeting, and populated upgrade proof. UI review also identifies the still-open A-admitted → B-created → A-failed → return-to-A draft/retry access defect. The test-type finding is the only one fixed by this small follow-up. No merge, deploy, live Gateway mutation, or repeated browser/performance proof was performed.

@openclaw-barnacle openclaw-barnacle Bot removed docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes commands Command implementations agents Agent runtime and tooling labels Nov 10, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 10, 2026
@Patrick-Erichsen
Patrick-Erichsen enabled auto-merge (squash) November 10, 2026 22:46
@clawsweeper clawsweeper Bot removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 10, 2026
@Patrick-Erichsen
Patrick-Erichsen merged commit db428c5 into main Nov 10, 2026
133 of 134 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the template-chat-first-ui branch November 10, 2026 23:23
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…#196395)

* feat(templates): admit durable chat before verified setup

* feat(templates): add directly into an editable pending chat

* test(templates): align CI fixtures with current owner contracts

* fix(templates): resume retained initialization through canonical owners

* fix(ui): retain Template drafts and retry setup in place

* test(templates): derive retained checkpoint from installer contract

* fix(templates): resume retained agents from active runtime facts

* fix(agents): preserve the immediate ordinary onboarding greeting

* fix(templates): roll back owned instructions before retained retry

* fix(templates): recover retained setup after a refused config write

* fix(templates): persist deferred bootstrap custody across restarts

* fix(ui): retain admitted Template recovery across new chats

* fix(agents): defer bootstrap schema addition to workspace writes

* refactor(gateway): extract workspace replies and session target validation

* test(templates): remove redundant installer adapter wiring case

* fix(ui): retire pending Template routing with composer scope

* fix(templates): persist initialization intent before retained effects

* fix(templates): format structured runtime application diagnostics

* test(templates): remove redundant CLI adapter wiring assertions

* fix(tests): preserve Template catalog fixture channel type

* perf(ui): defer Template receipt and creation completion work

* test(ui): reuse the Template detail fixture location

* test(ui): await plugin detail modules before routing assertions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant