Skip to content

refactor: scope memory import loading and progress to its workspace - #180423

Merged
steipete merged 2 commits into
mainfrom
solid2/w-s2-memory-cloud
Oct 22, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-s2-memory-cloud

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Memory import needs native Solid readiness and mutation feedback without allowing a pending request from a previous agent or connection to hold the next workspace's controls. Import failures also appeared behind the still-open confirmation dialog.

User Impact

Switching agents or reconnecting releases retired import/backfill progress. Completed plans, errors, and previews stay visible through repeated Gateway notifications and same-client reconnects. Failed imports keep their frozen retry intent and show the error inside the confirmation dialog.

Why This Change Was Made

The existing synchronous owner still admits requests, freezes idempotency keys, checks current authority, and records outcomes. Its projection supplies already-admitted promises to Solid loading/error boundaries; scoped optimistic actions present writes and retire independently of the request. No extra RPC, Gateway/config contract, or route loading change is introduced.

Evidence

Targeted formatting, UI typecheck, lint, production build, and the paired base/head startup-asset check pass. Direct Chromium proof against the production bundle covers cold loading, failed-plan refresh, held import, and rejected import with a readable confirmation error. Existing tests retain idempotent retry and stale-result coverage; the new regression covers switching agents before an import/backfill finishes.

The initial local Bun worker attempts did not execute tests. Full CI then identified two real retention regressions in the new async read adapters: a settled plan error and a completed backfill preview could briefly become pending again. The adapters now return settled owner state synchronously. The two original failed tests pass unchanged in a filtered local run, along with the existing rollback-error test (three passed); broad proof remains with ci:full.

The paired build keeps raw startup JS identical at 951,641 bytes and seven requests; shipped gzip differs by 30 bytes (316,219 → 316,249), within the 64-byte build-variance allowance. Chat/New route gzip changes are +57/+32 bytes; CSS is unchanged. No baseline was changed.

The change removes the handwritten revision signal. Production delta: +275/−108 lines (+167); tests: +68/−6 (+62). Growth supplies the scoped promise/action adapters and moves existing state declarations into a type-only module; it does not add another domain owner.

Before: the import error is hidden behind the confirmation

After: the rejected import keeps a readable error and retry in the confirmation

After: cold plan loading shows the native loading boundary

Keep request admission, frozen import intent, idempotency keys, and stale-result checks in the existing synchronous owner. Present admitted reads and mutations through scoped Solid primitives, and show import rejection inside its retained confirmation dialog.

Validation: targeted formatting, UI typecheck and lint, production Chromium loading/retry/rejection proof, and paired asset budget checks pass. Local Bun workers timed out before executing unit tests; ci:full must run the changed suites.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

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

@steipete
steipete marked this pull request as ready for review October 22, 2026 07:54
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T08:31:24.034865Z 29b63c7 New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6cb4e36807

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +663 to +668
<Errored
fallback={(error) => (
<div class="callout danger" role="alert">
{formatUiError(error())}
</div>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset the error boundary when retrying failed reads

After an initial plan request rejects, this Errored boundary switches permanently to its fallback because the fallback discards the provided reset callback. Clicking the still-visible Refresh button can issue and successfully complete another migrations.memory.plan request, but the provider list remains replaced by the original error until the page is remounted; switching agents has the same problem. The new preview boundary above has the equivalent failure after retrying a rejected preview. Connect the retry operations to each boundary's reset mechanism so a successful subsequent read can render.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR scopes Memory Import loading and progress to the active workspace and displays rejected imports inside their confirmation dialog.

Example: Importing one Codex memory file fails with “Synthetic import response unavailable.”

  • Before: The error appears behind the open confirmation dialog.
  • After: The confirmation displays the error above the available import action.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful visual evidence and a coherent owner-preserving implementation, but the asynchronous presentation change leaves two affected CI assertions failing.
Proof confidence 🐚 platinum hermit (4/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected production-bundle screenshots directly show cold loading and the corrected confirmation error, while pending workspace transitions are supported by the added page harness rather than supplied media.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Import errors are obscured by confirmation, and progress presentation must release a retired workspace while its admitted request finishes.
Reason: The feature-history owner authored this bounded adoption of the repository's Solid recipe, with a directly demonstrated improvement to error visibility and no new public contract.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: it provides a useful, focused presentation change that current main does not contain.

Priority: P2
Reviewed head: 6cb4e368073334b59c305068139c8432c5cd2176

Before merge

  • Await committed async reads in the existing page tests (P2) - The new planRead and previewRead memos return promises even for already-recorded owner state, but the existing tests still assume flush() immediately renders those values. Exact-head checks-ui (3/3) fails at line 345 because the planning error has not appeared and at line 488 because the reconnect preview is temporarily behind the re-armed Loading boundary. Update these assertions to await their observable states with waitForMemoryImport, retaining the redaction, request-count, preview, selection, and confirmation checks. If preview retention still fails after settlement, repair that behavior rather than weakening the assertion.

Findings

  • [P2] Await committed async reads in the existing page tests — ui/src/pages/memory-import/memory-import-page.test.tsx:339-345

Tests

  • Missing end-to-end proof: The supplied images do not demonstrate agent switching or reconnecting during a pending import/backfill, and no base-failure run is supplied for the added scope-change regression.
Agent review details

How this fits together

The Control UI Memory Import page consumes Gateway plans and backfill results, retains synchronous request admission and retry intent, and projects those outcomes into Solid loading, progress, and confirmation views.

flowchart LR
  A[Agent and Gateway selection] --> B[Synchronous import owner]
  B --> C[Gateway memory RPCs]
  C --> D[Accepted plans and results]
  D --> E[Scoped Solid presentation]
  E --> F[Import page and confirmation]
  F --> B
Loading

Technical review

Best possible solution:

Retain the existing synchronous owner and scoped Solid adapters, and adapt the affected tests to await committed presentation without weakening their assertions.

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

The base rendering places apply errors outside the retained confirmation, matching the supplied before screenshot; exact-head CI also records the two affected test failures, and no target code was executed during this review.

Is this the best way to solve the issue?

The change follows the established admitted-promise and scoped-action recipe while preserving request authority, idempotency, and stale-result checks; the pinned runtime does not support the earlier permanent-error-boundary finding.

Full review comments:

  • [P2] Await committed async reads in the existing page tests — ui/src/pages/memory-import/memory-import-page.test.tsx:339-345
    The new planRead and previewRead memos return promises even for already-recorded owner state, but the existing tests still assume flush() immediately renders those values. Exact-head checks-ui (3/3) fails at line 345 because the planning error has not appeared and at line 488 because the reconnect preview is temporarily behind the re-armed Loading boundary. Update these assertions to await their observable states with waitForMemoryImport, retaining the redaction, request-count, preview, selection, and confirmation checks. If preview retention still fails after settlement, repair that behavior rather than weakening the assertion.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Synchronous admission and frozen import intent keeps the original intent (4319ddb: Provide reviewed, agent-scoped memory imports with frozen selection and retry-safe idempotency.)
  • Solid rendering and retained recovery keeps the original intent (d64ce70: Move the page to Solid while retaining captured connections, agents, and uncertain-import recovery keys.)
  • Owner-driven planning keeps the original intent (e82a3c0: Admit plans from owner receipts and suppress unrelated replanning while preserving explicit retry.)
  • Reconnect preservation keeps the original intent (c7d9291: Preserve drafts and loaded data across same-identity reconnects while retiring protected state on identity or access changes.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/memory-import/memory-import-page.test.tsx src/pages/memory-import/view.test.tsx --maxWorkers=1
  • pnpm tsgo:ui
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c7d9291 adds ui/src/pages/memory-import/memory-import-page.test.tsx:408 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c7d92911be35; files: ui/src/pages/memory-import/memory-import-page.test.tsx)

PR surface

Source +157, Tests +62. Total +219 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 265 108 +157
Tests 2 68 6 +62
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 333 114 +219

Review metrics

Metric Value Why it matters
Production versus test growth Production +265/−108 lines; tests +68/−6 lines Growth supplies scoped read/action presentation and a type-only state extraction; the added tests protect pending-operation scope changes without adding another domain owner.

Labels

Label changes:

  • add P2: This is a bounded Memory Import presentation improvement with a concrete repair needed in the affected test suite.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a bounded Memory Import presentation improvement with a concrete repair needed in the affected test suite.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🐚 platinum hermit and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 22, 2026, 4:11 AM ET / 08:11 UTC.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 08:38
@steipete
steipete merged commit dfc65ff into main Oct 22, 2026
103 of 105 checks passed
@steipete
steipete deleted the solid2/w-s2-memory-cloud branch October 22, 2026 08:46
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…penclaw#180423)

* refactor: scope memory import loading and progress to its workspace

Keep request admission, frozen import intent, idempotency keys, and stale-result checks in the existing synchronous owner. Present admitted reads and mutations through scoped Solid primitives, and show import rejection inside its retained confirmation dialog.

Validation: targeted formatting, UI typecheck and lint, production Chromium loading/retry/rejection proof, and paired asset budget checks pass. Local Bun workers timed out before executing unit tests; ci:full must run the changed suites.

* fix: retain settled memory import reads across notifications
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant