Skip to content

feat(research): retain authorized browser research state - #177231

Merged
vincentkoc merged 12 commits into
mainfrom
openclaw/research-view-client-20261019
Nov 6, 2026
Merged

vincentkoc merged 12 commits into
mainfrom
openclaw/research-view-client-20261019

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Problem

Research panes need conversation-bound views and safe retry behavior without exposing one authenticated account’s private question to another account or submitting paid work twice after an uncertain reply.

Changes

  • Keep pending starts behind the existing Gateway credential/recovery owner, scoped to the authenticated account, plugin, agent, and conversation. Add the optional versioned recoveryStorage SDK capability; retire captured handles and stored drafts when their owner changes.
  • Preserve the exact request key after an uncertain start. Only the producer’s explicit not-accepted marker clears a definitive rejection. Generic transport errors do not authorize a fresh submission; reconnects and remounts never start work automatically.
  • Fence stale read/action replies and reauthorize the server incarnation before restoring private content. Reactivate plugin views when the first recovery account becomes ready, without remounting again for an unchanged scope.
  • Keep account retirement synchronous in the early connection code, but load the optional storage-handle factory with the existing lazy plugin host. Goal cleanup remains at its original late recovery-scope callback.
  • Remove replayed copies of the already-landed Gateway tests and their duplicate project registration. No new renderer, durable state service, or automatic retry loop.

Stack and scope

The server-view layer is merged in #177230. The native pane and final responsive screenshots follow in #177232. The native and Google acceptance gates were completed in their merged predecessor PRs. This is source publication, not a production Gateway deployment or restart.

Verification

  • Exact signed head: ff272050db71c4e6ae58bb23ccdbf9a05a4a99a1; tree: 44866a785e17af8bc88d0442320aead44f21131a.
  • Native ancestry-preserving baseline onto actual view squash 6e3d9d30d03799f92e8ba431f35d8ba5f6bf99c0. Independent audit approved all 26 conflict resolutions as byte-identical lower-owner blobs.
  • The original account-switch draft leak and first-recovery-ready lifecycle defect both have red/green proof. The owning client/routing run passed 11 + 41 tests; Control UI runtime, host, and device-credential suites passed 51 tests. The client suite now declares its actual jsdom environment.
  • The retained full-stack Chromium build passed same-account remount, account replacement, and held old-account reply checks. This is real bundled-plugin/browser behavior with a synthetic Gateway fixture, not a live-provider claim or exact-client-head UI deployment.
  • Core, UI, extension production/test types, five targeted typed-lint groups, SDK export registration, formatting, extension-test boundary, controller guard, and 16,467 documentation links passed. Test-line budget: 6,548,658 / 6,548,664; all 436 new test lines are credited by 371 + 65.
  • The earlier 6e3d9d30..50157454 review and the new 50157454..ff272050 correction review are P0–P2 scoped-clean. The correction’s local and committed reviews scored 0.91 and 0.88. Its full production build passed; build-info matches ff272050. The unchanged SDK API inputs retain the completed comparison: one added type and optional host member only (acknowledgement digest e34ea508), with no removal or required-member change.
  • Prior-head CI run 42245795698 failed the private-import, readiness-fixture type, and startup-size checks. The correction uses the public plugin barrel, fixes the initializer’s return type, and removes the accidental eager dependency. The exact boundary/type checks, 79 affected UI tests, and source-paired asset budgets now pass. Replacement-head CI 42253402328 completed with all three repaired jobs green. It failed only the global test-line ratchet and downstream aggregate: the exact main baseline and tested merge are both 34 LF over, independently recounted from Git objects; this PR adds exactly 436 LF and 436 LF of allocation. security-fast and every other selected job passed. The native inherited-failure route retains this failed CI result.

Performance correction acceptance

The existing cold-entry asset workload is pnpm ui:check-performance:base <exact-comparison-base>. The failing CI tested merge aca744f6b82f036516e7093c823fee4ce460f450 against base 73005a14b8c2c68565e7a8abfffa6834a160a5f2: normalized startup JavaScript was 93,019 B gzip versus the 90,198 B enforcement limit (89,622 B base + 512 B growth + 64 B variance). Accept the correction only when the same owner’s source-paired comparison passes every enforced asset budget without raising a baseline or allowance. This is deterministic asset-size evidence, not a latency benchmark.

The corrected source-paired run against 6e3d9d30d03799f92e8ba431f35d8ba5f6bf99c0 passed all unchanged budgets: startup 90,378 B (limit 90,856), chat 1,289,069 B (limit 1,289,482), new-session 797,502 B (limit 797,620), and largest JS 547.0 KiB (limit 547.2 KiB). The comparison used clean, matched generated-plugin inputs; the previous package-build outputs were retained separately. Source maps confirm that synchronous retirement stays in the connection chunk and the factory loads with the plugin host.

@clawsweeper

clawsweeper Bot commented Oct 19, 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: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

This PR adds account-bound browser recovery for research requests and a versioned plugin storage capability.

Example: Account A starts research for “How do urban trees reduce summer heat?” and loses the response.

  • Before: The browser lacks account-bound recovery for the original question and request key.
  • After: The same account can recover that request after remounting, while another account receives a separate storage namespace.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) Useful owner-approved direction, but an actionable retry-expiry defect and incomplete authority evidence block readiness.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Users need to recover uncertain research starts without repeating paid work or exposing private questions after switching accounts.
Reason: The maintainer-authored direction provides useful recovery through existing owners; the earlier offline-report finding no longer matches the narrowed remount-recovery claim.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this maintainer-authored PR open: account isolation is improved, but an expired uncertain-start key can submit work again after server deduplication expires.

Priority: P2
Reviewed head: 501574542119fec80584c5943d82897f7c715252

Before merge

  • Add real behavior proof - Authority-chain proof required: the body reports bundled-plugin Chromium remount, account-replacement, and held-old-account-reply checks, but provides no inspectable output mapping the changed storage owner to rejection before display or RPC; publish those results and credential-revocation coverage with credentials and non-public endpoints redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Stop uncertain retries when server deduplication expires (P2) - If a start is accepted but its response is lost, this client retains the request indefinitely and resends it here after any same-incarnation refresh. Research job receipts expire after seven days (job-state.ts:49, jobs.ts:286), and accepted-session-work records have the same TTL. After those records expire, ResearchJobs.start sees no prior job and queues work again under the same key. A tab left open across that interval can therefore repeat paid research while presenting the action as a safe retry. Record a bounded retry lifetime aligned with the server contract, refuse expired uncertain retries without silently minting a new request, and add an expiry regression.
  • Resolve security review attention item - The previous account-leak path is repaired in source, while final-effect retirement evidence remains incomplete.
  • Resolve merge risk - Before merge, the PR owner must establish that account retirement invalidates captured recovery handles before a previous account's draft can reach the replacement account or a start RPC.

Findings

  • [P2] Stop uncertain retries when server deduplication expires — extensions/deep-research/browser/client.ts:299-303

Tests

  • Missing end-to-end proof: Publish an inspectable native-browser trace of same-account recovery and replacement or revoked-account rejection before draft display or start RPC.
Agent review details

How this fits together

The research browser client turns native panel actions into authenticated Gateway research RPCs and stores uncertain starts through the Control UI credential owner.

flowchart LR
  A[Research panel] --> B[Research browser client]
  B --> C[Account bound recovery storage]
  D[Gateway credential owner] --> C
  B --> E[Authenticated research RPC]
  E --> F[Research job service]
  F --> G[Expiring job receipts]
Loading

Technical review

Best possible solution:

Keep the existing account recovery owner and bound uncertain retries to the server’s deduplication lifetime without silently converting an expired retry into new work.

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

Source shows that an uncertain start retained beyond the server’s seven-day receipt lifetime can be admitted again under the same conversation incarnation; no target code or tests were executed.

Is this the best way to solve the issue?

The account-bound SDK seam fits the existing credential owner, and the added tests cover distinct failures, but retaining the same key alone cannot guarantee safe retries after server receipts expire.

Full review comments:

  • [P2] Stop uncertain retries when server deduplication expires — extensions/deep-research/browser/client.ts:299-303
    If a start is accepted but its response is lost, this client retains the request indefinitely and resends it here after any same-incarnation refresh. Research job receipts expire after seven days (job-state.ts:49, jobs.ts:286), and accepted-session-work records have the same TTL. After those records expire, ResearchJobs.start sees no prior job and queues work again under the same key. A tab left open across that interval can therefore repeat paid research while presenting the action as a safe retry. Record a bounded retry lifetime aligned with the server contract, refuse expired uncertain retries without silently minting a new request, and add an expiry regression.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Demonstrate account retirement at the final boundary (recommended)
    The PR owner should publish redacted browser and Gateway output showing same-account recovery, replacement-account exclusion, and rejection of retained handles after credential revocation before disclosure or RPC.

Provenance checked

Testing

Proof path: unit tests only.

Security

Needs attention: The previous account-leak path is repaired in source, while final-effect retirement evidence remains incomplete.

Evidence

What I checked:

PR surface

Source +517, Tests +434, Docs +12, Other +3. Total +966 across 14 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 9 520 3 +517
Tests 2 434 0 +434
Docs 1 23 11 +12
Config 0 0 0 0
Generated 0 0 0 0
Other 2 3 0 +3
Total 14 980 14 +966

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Public SDK expansion 1 optional host member and 1 versioned type The recoveryStorage addition preserves existing required members and documents its lifetime contract.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: The PR expands the public plugin SDK with an optional recovery-storage capability.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is none.

Label justifications:

  • P2: This is an unreleased research improvement with a bounded but concrete duplicate-work failure after receipt expiry.
  • merge-risk: 🚨 compatibility: The PR expands the public plugin SDK with an optional recovery-storage capability.
  • merge-risk: 🚨 security-boundary: Private retry drafts cross account and credential lifetimes through a new storage capability whose final-effect retirement proof remains incomplete.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-19T10:25:36.169Z sha 964fa83 :: needs real behavior proof before merge. :: [P1] Scope retained starts to the authenticated recovery owner | [P2] Retain offline snapshots across the native host lifecycle

Reviewed November 6, 2026, 10:50 AM ET / 15:50 UTC (Revision 2).

@vincentkoc
vincentkoc force-pushed the openclaw/research-view-api-20261019 branch from 4d1c46c to 1c53521 Compare November 6, 2026 04:24
@vincentkoc
vincentkoc force-pushed the openclaw/research-view-client-20261019 branch from 964fa83 to 3a96940 Compare November 6, 2026 04:31
@vincentkoc vincentkoc self-assigned this Nov 6, 2026
Base automatically changed from openclaw/research-view-api-20261019 to main November 6, 2026 15:16
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts labels Nov 6, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review November 6, 2026 15:44
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The exact reviewed head is 501574542119fec80584c5943d82897f7c715252. The body now records the account-bound recovery fix, first-account readiness regression, real bundled-plugin browser proof, exact SDK API comparison, full build, and scoped-clean local/committed reviews. Please refresh the assessment on this head.

@clawsweeper

clawsweeper Bot commented Nov 6, 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 6, 2026
@vincentkoc
vincentkoc merged commit ecb7169 into main Nov 6, 2026
132 of 135 checks passed
@vincentkoc
vincentkoc deleted the openclaw/research-view-client-20261019 branch November 6, 2026 16:53
@vincentkoc

Copy link
Copy Markdown
Member 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 Nov 7, 2026
…7231)

* fix(research): keep evidence types in their leaf contract

* test(codex): account for native research boundary coverage

* feat(google): add authority-bound managed research adapter

* feat(research): retain conversation-bound jobs and evidence

* feat(research): recover durable jobs through current source authority

* feat(research): activate lazy bundled research by default

* feat(research): bind native search to selected model and evidence

* feat(research): expose current-authority retained job views

* feat(research): retain authorized browser research state

* fix(research): bind browser recovery to account

* fix(research): keep browser recovery off startup
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 docs Improvements or additions to documentation extensions: deep-research merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant