Skip to content

fix(ui): autosave acks wipe open add-entry drafts and in-progress JSON text - #123502

Merged
steipete merged 5 commits into
mainfrom
codex/autoqa-ack-draft-wipe
Aug 14, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/autoqa-ack-draft-wipe

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Toggle any switch, then click "Add" on an array/map and start typing — about a second later the debounced autosave ack lands and the add-entry panel silently vanishes with the typed key/value. Same for in-progress (not-yet-valid) JSON in a map entry: the textarea resets mid-typing. An unrelated committed write destroys component-local input with no visible reason.

Why This Change Was Made

adoptConfigSetAck (and the non-preserving applyConfigSnapshot path reached via config.changed) replaces the whole form with cloneConfigObject(parsed) — every object/array identity changes while content stays byte-identical. ConfigFormCollectionDraft.willUpdate closed the draft on !Object.is(sourceIdentity) and the JSON textarea ref reset element.value on sourceValue identity change. Both guards now use identity-or-content: Object.is short-circuits the hot path, configValuesEqual (the existing schema-value equality) decides when identity churns. A genuinely external content change still closes the draft / resets the textarea exactly as before — two existing tests that accidentally pinned the destructive byte-identical case were tightened to assert the content-change semantics instead (external change closes, identical-content churn preserves).

User Impact

In-progress form input survives the autosave cycle that the form itself triggers. No more disappearing add-entry panels or erased JSON while editing settings.

Evidence

  • New regression in config-form-array-integrity.browser.test.ts: open draft + typed text survives a re-render with identical content (fails pre-fix: draft closed, text lost). Suite 14 passed.
  • config-form-integrity.browser.test.ts: tuple-draft test now proves both directions (identical-content churn keeps the draft; real external change closes it); JSON-reset test uses a genuine content change. 11 passed.
  • Full ui components suite: 1434 passed. pnpm tsgo:ui clean.
  • Fresh autoreview (codex/gpt-5.6-sol, high): clean, "patch is correct (0.96)".
  • Production LOC: +12/−3, of which 6 are invariant comments.

Found via the config/settings lane of the round-2 web-UI QA campaign (finding L21-2).

…ogress JSON

A drained autosave ack (and the config.changed refresh path) clones the
whole config form, changing every object/array identity while content is
byte-identical. The collection add-entry draft closed on identity change
and the JSON textarea reset its uncommitted text — the operator's typing
vanished ~1s after any earlier toggle. Both guards now check content
equality when the identity churns; a genuinely external content change
still closes/resets as before.
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 14, 2026 05:37
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 14, 2026
@clawsweeper clawsweeper Bot added 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. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 14, 2026, 7:46 AM ET / 11:46 UTC.

ClawSweeper review

What this changes

The PR preserves open collection-entry drafts and invalid JSON text when an autosave acknowledgement replaces form values with equal cloned objects.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open: the reset guards are localized to the two owning UI controls, but both requested equal-clone regressions remain unproven and the collection-draft comment still exceeds the scoped three-line limit.

Priority: P2
Reviewed head: c8dc683e6d15a041d9042d2e9ae3a3330cd28276

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is plausibly localized, but two P2 regression gaps leave its central autosave-clone behavior unproven.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body reports browser-suite output, but the remaining blocker is missing exact regression coverage rather than contributor proof.
Patch quality 🦐 gold shrimp (3/6) 3 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body reports browser-suite output, but the remaining blocker is missing exact regression coverage rather than contributor proof.
Evidence reviewed 6 items Autosave clone producer: A drained autosave acknowledgement adopts the submitted config by cloning parsed values into the form state, which changes nested object and array identities while retaining content.
Reset-owner implementation: The proposed collection and JSON controls use identity as a fast path and config-value equality only when identities differ; their callers pass array/map entry values as the source identities.
Array regression gap: The new rerender still goes through a helper that always supplies value: undefined; renderArray maps that to one shared unset identity, so the pre-fix identity-only guard would also preserve the draft.
Findings 3 actionable findings [P2] Exercise a defined cloned array in the autosave regression
[P2] Retain invalid JSON through an equal cloned map snapshot
[P3] Shorten the collection-draft invariant comment
Security None None.

How this fits together

The Control UI renders editable configuration from the runtime config draft. Autosave acknowledgements replace that draft with persisted config, and collection drafts or JSON textareas decide whether to retain local typing or reset for a real external value change.

flowchart LR
  A[Settings form input] --> B[Runtime config draft]
  B --> C[Autosave acknowledgement]
  C --> D[Cloned config snapshot]
  D --> E[Collection and JSON reset checks]
  E --> F[Preserve local typing]
  E --> G[Reset after external change]
Loading

Before merge

  • Exercise a defined cloned array in the autosave regression (P2) - This rerender still passes value: undefined; renderArray converts both renders to the same unset-source sentinel, so the old identity-only guard also keeps the draft open. Start with a defined array and rerender an equal clone so the test fails before this patch.
  • Retain invalid JSON through an equal cloned map snapshot (P2) - This test proves reset after changed primary content, but it never rerenders an equal cloned map while invalid text is present. The pre-patch textarea reset would still erase that text, leaving the new preservation path unprotected.
  • Shorten the collection-draft invariant comment (P3) - The applicable UI policy limits invariant comments to three short lines; this unchanged four-line comment remains after the prior review. Compress it without losing the autosave-clone rationale.
  • Resolve merge risk (P1) - The equal-cloned array and JSON-map paths are untested, so a later refactor could restore draft loss without failing these regressions.
  • Resolve merge risk (P1) - Production code is net +9 lines; the separate element and textarea reset owners do not justify a shared abstraction, but the four-line collection comment should be reduced to the required three lines.

Findings

  • [P2] Exercise a defined cloned array in the autosave regression — ui/src/components/config-form-array-integrity.browser.test.ts:195-200
  • [P2] Retain invalid JSON through an equal cloned map snapshot — ui/src/components/config-form-integrity.browser.test.ts:1008-1017
  • [P3] Shorten the collection-draft invariant comment — ui/src/components/config-form-collection-draft.ts:41-44
Agent review details

Security

None.

PR surface

Source +9, Tests +33. Total +42 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 12 3 +9
Tests 2 35 2 +33
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 47 5 +42

Review metrics

Metric Value Why it matters
Production versus test LOC production +12/-3 (net +9); tests +35/-2 (net +33) The bug fix adds two reset branches and invariant comments; the added tests must exercise the clone path those branches protect.

Stored data model

Persistent data-model change detected: vector/embedding metadata: ui/src/components/config-form-array-integrity.browser.test.ts, vector/embedding metadata: ui/src/components/config-form-integrity.browser.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the clone-path regressions (recommended)
    Render a defined array and JSON map, rerender equal clones while text is in progress, then keep the existing changed-content reset assertions.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Replace the unset array fixture with a defined value followed by an equal clone; add invalid-JSON retention across an equal cloned map; shorten the collection invariant comment to three lines; rerun both focused browser suites.

Technical review

Best possible solution:

Keep the owner-local equality checks, add real cloned-value coverage for both controls, and retain reset coverage for genuinely changed external values.

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

Yes, source-reproducible: autosave clones a clean config form and the pre-patch reset guards treated the resulting identity change as an external update. No live browser reproduction was run in this read-only review.

Is this the best way to solve the issue?

Yes, with the missing tests: semantic equality belongs at the two UI reset owners, while a real source-content change still takes the reset path.

Full review comments:

  • [P2] Exercise a defined cloned array in the autosave regression — ui/src/components/config-form-array-integrity.browser.test.ts:195-200
    This rerender still passes value: undefined; renderArray converts both renders to the same unset-source sentinel, so the old identity-only guard also keeps the draft open. Start with a defined array and rerender an equal clone so the test fails before this patch.
    Confidence: 0.99
  • [P2] Retain invalid JSON through an equal cloned map snapshot — ui/src/components/config-form-integrity.browser.test.ts:1008-1017
    This test proves reset after changed primary content, but it never rerenders an equal cloned map while invalid text is present. The pre-patch textarea reset would still erase that text, leaving the new preservation path unprotected.
    Confidence: 0.98
  • [P3] Shorten the collection-draft invariant comment — ui/src/components/config-form-collection-draft.ts:41-44
    The applicable UI policy limits invariant comments to three short lines; this unchanged four-line comment remains after the prior review. Compress it without losing the autosave-clone rationale.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 37a63fbf450e.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded Control UI settings-state bug that can erase in-progress operator input during normal autosave.
  • merge-risk: 🚨 session-state: The changed guards decide whether unsaved editor state is retained or reset as configuration snapshots arrive.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body reports browser-suite output, but the remaining blocker is missing exact regression coverage rather than contributor proof.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs ui/src/components/config-form-array-integrity.browser.test.ts.
  • [P1] node scripts/run-vitest.mjs ui/src/components/config-form-integrity.browser.test.ts.
  • [P1] git diff --check.

What I checked:

Likely related people:

  • steipete: The locally available provenance identifies steipete as author of the original UI fix commit; older file-history ownership could not be resolved from this partial checkout. (role: current UI config-change author; confidence: low; commits: b602a0333011, c8dc683e6d15; files: ui/src/components/config-form-collection-draft.ts, ui/src/components/config-form.node.shared.ts)

Rank-up moves

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

  • Use a defined array plus an equal clone in the collection-draft regression.
  • Add equal-cloned-map retention before the changed-content JSON reset assertion.
  • Reduce the collection invariant comment to three lines.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-14T05:41:51.733Z sha b602a03 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T07:29:18.091Z sha 13dded5 :: found issues before merge. :: [P2] Exercise cloned array content in the autosave regression | [P2] Cover cloned JSON-map values before asserting reset behavior
  • reviewed 2026-08-14T09:35:21.178Z sha 4756637 :: found issues before merge. :: [P2] Exercise a defined cloned array in the autosave regression | [P2] Assert JSON draft retention across an equal cloned map | [P3] Keep the collection-draft invariant comment to three lines

@clawsweeper clawsweeper Bot added 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 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 Aug 14, 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. labels Aug 14, 2026
@steipete
steipete merged commit c3ae887 into main Aug 14, 2026
153 checks passed
@steipete
steipete deleted the codex/autoqa-ack-draft-wipe branch August 14, 2026 11:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…ogress JSON (openclaw#123502)

A drained autosave ack (and the config.changed refresh path) clones the
whole config form, changing every object/array identity while content is
byte-identical. The collection add-entry draft closed on identity change
and the JSON textarea reset its uncommitted text — the operator's typing
vanished ~1s after any earlier toggle. Both guards now check content
equality when the identity churns; a genuinely external content change
still closes/resets as before.
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 maintainer Maintainer-authored PR merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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