Skip to content

fix: avoid resolving prepared chat identity twice - #185661

Merged
steipete merged 1 commit into
mainfrom
solid2/readiness-resolve-followup
Oct 27, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/readiness-resolve-followup

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Reloading an already-canonical short chat URL can resolve the same conversation twice after its prepared identity is confirmed.

Related: #185454.

User Impact

Chat keeps its early prepared display, editable draft, and live title/URL updates while avoiding the second session-discovery request. Snapshot verification, reconnect checks, and explicit refresh retain their authoritative lookups.

Why This Change Was Made

The same-URL confirmation introduced in #185454 released pending route state by reloading the route. That issued an exact-key sessions.resolve after the short-ID request had already confirmed the same identity. The route owner now changes its existing pending fields into the confirmed location, and the page uses ordinary URL replacement. The router can publish that same-location update without running the loader again. Both immediate and deferred canonicalization preserve consumed drafts.

The existing held-response E2E now asserts one resolution after its title, URL, draft, and history checks. Test-only artifacts retain synthetic resolution parameters before assertions fail; no production diagnostic or cache was added.

Evidence

Check Result
Deterministic pre-fix reproduction on eec9cd2790e Existing prepared-identity flow failed: 2 resolves, first shortId, then reference.key; prior title/URL/draft/history assertions passed
Same flow with fix and prepared-identity siblings 4/4 passed; retained requests contain only the original short-ID lookup
Real Gateway loading case Passed: one resolve, selected tail before restored Home, avatar reuse, pagination, and warm reload; test 14.05 s, file 25.11 s
Prepared-identity owner tests 22/22 passed, including stale authority, cancellation, conflicting identity and canonical handoff; file 2.12 s
UI typecheck Passed
Scoped lint, format, controller guard Passed
Production Knip Sole failure is pre-existing unlisted uptime in scripts/perf/local-workspace-manifest-measure.ts; identical base failure on e990b80. Owner/package/lock/runner hashes unchanged; config delta adds only unrelated performance entries
Isolated Codex review Scoped-clean, no actionable P0–P2 findings
Strict production asset checks Base and head passed, including relative checks

Same-machine production builds with identical installed dependencies, prepared plugin inventory and build-input paths (3,562 entries, 3,555 unique):

Surface Base gzip Head gzip Change Requests
Startup JS 271,206 B 270,967 B -239 B 5 → 5
Startup CSS 32,702 B 32,702 B 0 B 1 → 1
Chat boot JS 1,267,435 B 1,267,190 B -245 B 20 → 20
New Session boot JS 769,024 B 768,835 B -189 B 16 → 16

Startup raw JS is 840,734 B on both sides. The base was rebuilt with the same prepared distributions as the final head after the real-Gateway test prepared additional plugin outputs; earlier unmatched-build receipts are retained but are not used for patch attribution. Both strict absolute and relative checks pass, with no budget changes. No eager import or dependency was added.

This proves removal of one redundant RPC, not a measured latency or CPU improvement. The earlier real-Gateway failure also reproduced on base e990b80; scheduled main 1299676 predates #185454 and passed that case. No claim is made that all historical main runs failed.

Production LOC: 1,416 → 1,418 (+2). Test LOC: 841 → 855 (+14). Four files, +40/−24 overall. UI appearance is unchanged.

Full CI attribution

CI run 40469618451 completed with 33 successful jobs, 27 skipped, and two failed leaf jobs plus the aggregate. security-fast passed. The two failures are retained as failures:

Failed test Matching baseline proof
Control UI agent config save > recovers failed loads and resumes autosave after reloading a reconnected draft Actual earlier CI main 7bf995 reproduces the same disabled/aria-busy Reload Config at line 76. Local timeout 10 s versus CI 30 s; functional evidence includes disclosed native-materialization overlap. The test and three config owners are byte-identical to this CI's main parent 3939d79.
Control UI catalog bootstrap > real chat route recovers current account state after pending snapshot ordering Scheduled-main job 122053691560 fails the identical line 395 assertion, expected 2 / received 3. The test, catalog store, reader and cache are byte-identical from that main head 9b7db694 through this PR head.

No CI rerun or local replay was used to replace either failure. The original auto-merge request was confirmed cancelled after a 502 response; landing uses the documented inherited-failure recovery route.

Settle matching prepared route confirmation through its existing canonical location and ordinary replacement. Preserve draft consumption and live title updates without reloading the confirmed session.

Release-note context: canonical short chat URLs keep early history and composer readiness while issuing one session resolution. Related: #185454.
@steipete steipete added app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 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.

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Contributor

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-27T07:53:10.073266Z 4254e84 PR opened
ℹ️ 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR settles confirmed prepared chat routes without reloading the route and resolving the same conversation again.

Example: Reload /chat/main/current-title-12345678 and receive matching prepared identity before session resolution completes.

  • Before: Confirmation triggers a second sessions.resolve request using the resolved session key.
  • After: The original short-ID lookup confirms the route, while drafts and subsequent title-driven URL updates remain available.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported repair with no actionable findings; reported behavior validation is credible but lacks an inspectable trace, and CI is unresolved.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; its body reports production-browser red/green resolution counts and a real-Gateway loading pass, while directly inspectable evidence consists of source and test assertions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Reloading an already-canonical chat link performs unnecessary session discovery after confirming the same conversation.
Reason: The maintainer-authored direction removes demonstrated redundant work while retaining early drafting and live URL updates.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it removes a source-confirmed redundant lookup using the existing route owner, with no actionable patch defects found; exact-head CI remains unresolved.

Priority: P2
Reviewed head: 4254e8421d76edd340345ffc2d895b587fa07f76

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Reported browser and real-Gateway passes are scenario-specific, but no directly inspectable after-fix request trace is supplied.
Agent review details

How this fits together

The Control UI route loader combines prepared Gateway identity with authoritative session resolution; the chat page publishes the confirmed location through the router, and shell navigation uses the settled identity for live URL updates.

flowchart LR
  A[Prepared Gateway identity] --> C[Chat route loader]
  B[Session resolution] --> C
  C --> D[Chat page]
  D --> E[Router replacement]
  E --> F[Shell route state]
  F --> G[Live title URL updates]
Loading

Technical review

Best possible solution:

Keep confirmed identity in the existing route data and publish ordinary replacement while preserving authoritative refresh and reconnect paths.

Do we have a high-confidence way to reproduce the issue?

Current-main source directly connects same-location confirmation to revalidation and an exact-key lookup, consistent with the reported two-request browser reproduction; this review executed no target code.

Is this the best way to solve the issue?

The patch is the smallest complete repair: it settles the existing pending route fields and removes the reload, without adding another cache, owner, or API.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f92b9727b6b7.

Provenance checked

  • Prepared short-route confirmation keeps the original intent (dcd9015: Expose the prepared conversation early while authoritative resolution controls compatible canonicalization.)
  • Same-location route revalidation changes intended behavior with a stated reason (59c7f75: Release provisional route admission after confirmation so subsequent title changes can update the URL.)
  • Chat-page lifecycle and draft preservation keeps the original intent (58a7c26: Keep page lifetime and asynchronous draft cleanup under the mounted Solid owner.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit dcd9015 adds ui/src/pages/chat/route-loader.ts:516 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dcd90156c055; files: ui/src/pages/chat/route-loader.ts)

PR surface

Source +2, Tests +14. Total +16 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 26 24 +2
Tests 2 14 0 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 40 24 +16

Labels

Label changes:

  • add P2: The extra discovery request adds limited chat-loading overhead while the conversation remains usable.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The extra discovery request adds limited chat-loading overhead while the conversation remains usable.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Classify the exact-head Agents Reload Config failure and satisfy the remaining required checks.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 27, 2026, 4:06 AM ET / 08:06 UTC.

@steipete
steipete enabled auto-merge (squash) October 27, 2026 08:08
@steipete
steipete disabled auto-merge October 27, 2026 08:14
@steipete
steipete merged commit 6f8c9ba into main Oct 27, 2026
107 of 114 checks passed
@steipete
steipete deleted the solid2/readiness-resolve-followup branch October 27, 2026 08:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
Settle matching prepared route confirmation through its existing canonical location and ordinary replacement. Preserve draft consumption and live title updates without reloading the confirmed session.

Release-note context: canonical short chat URLs keep early history and composer readiness while issuing one session resolution. Related: openclaw#185454.
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant