Skip to content

fix(agent,workbench): isolate unreadable recall records and rebind retired UI watches - #6638

Merged
M4n5ter merged 1 commit into
rust-previewfrom
fix/recall-and-rebind-resilience
Nov 5, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
fix/recall-and-rebind-resilience

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Isolate unreadable historical records during Recall search and catalog browsing without runtime compatibility shims:
    • Classify StoreError::Json as an isolated unreadable_source failure in EventLog transcript/recall maintenance (platform/event-log/src/transcript/directory.rs) so an historical source event written under an earlier schema (such as pre-SourceCapture model_requested events) is recorded in transcript_failures and surfaced through RecallPage.gaps (complete: false) instead of aborting partition search, while SQLite/storage and invariant errors continue to fail fast.
    • Add per-session decode outcome pagination (EventLog::root_catalog_record_outcomes / RootStore::scoped_session_outcomes) so all-session Recall searches (Recall::list / Recall::query / Recall::find / search::titles) and agent.list (catalog_page) isolate unreadable session metadata/workspace bindings into gaps or skipped entries with preserved keyset cursors, while targeted single-session Recall queries (session_id: Some(...)) still return the error directly.
  • Rebind retired UiScope / ApplicationHost bindings and reconnect persistent workbench watches across service reconfiguration:
    • Clear Client::binding_retired after a successful owned-session Client::refresh() (products/maka/client/src/lib.rs), refresh owner.read_ui on retired/stale Services::capture() in UiScope (products/maka/workbench/src/bindings/ui_services.rs), retry read-only UiScope / ApplicationClient queries & subscriptions once when admission retires a cached binding (products/maka/workbench/src/bindings.rs), and refresh the root ApplicationHost when management.watch updates UI sources (products/maka/workbench/app/plugins/registry.ts).
    • Treat *_observation_cancelled and client subscription cancelled as clean activation handoffs (isObservationCancelled in products/maka/workbench/app/text.ts) and reconnect persistent UI streams (browsing.ts, Checklist.tsx, CurrentFile.tsx, workspaceFileState.ts, botTranscriptCore.ts, messageSenders.ts, terminalState.ts, sessionGoal.ts, and Conversation.tsx) without flashing bottom-left "刷新浏览器" errors or dropping mounted session state.

One-time migration for existing data

Offline migration script, unit tests, and backup/restore instructions:
https://gist.github.com/M4n5ter/291dc2f494a66ec779b8559b5362a330

The runtime retains only the strict current event and session configuration schemas (zero legacy compatibility branches). Existing local stores containing pre-SourceCapture model_requested events or pre-BindingRef inline session workspaces can be migrated offline in one step after stopping Maka and its Host:

python3 migrate_recall_sources.py --host-root "$HOME/.maka/application/host"
python3 migrate_recall_sources.py --host-root "$HOME/.maka/application/host" --apply

Verification

  • cargo fmt --all -- --check — pass
  • cargo clippy --locked -p maka-event-log -p maka-assistant -p maka-app-client -p maka-workbench --all-targets -- -D warnings -A clippy::too_many_arguments — pass
  • cargo nextest run -p maka-event-log --lib projection_classification recall catalog — pass
  • cargo nextest run -p maka-assistant --lib — pass
  • cargo test -p maka-agent-native --lib recall -- --test-threads=2 — 6/6 pass
  • cargo test -p maka-agent-native --lib owner::tests::catalog -- --test-threads=2 — 3/3 pass
  • cargo nextest run -j 4 -p maka-app-client --lib — 29/29 pass
  • cargo test -p maka-workbench --lib -- --test-threads=2 — 13/13 pass
  • node --test products/maka/workbench/tests/*.test.mjs — 90/90 pass
  • node scripts/ci.mjs check format && node scripts/ci.mjs check licenses && node scripts/ci.mjs check notices — pass
  • node packages/plugin-sdk/scripts/generate.mjs check && node node_modules/typescript/bin/tsc -p packages/plugin-sdk/tsconfig.acceptance.json && node node_modules/typescript/bin/tsc -p products/maka/bundle/tsconfig.json — pass
  • Offline migration Gist verification: python3 -W error::ResourceWarning -m unittest -v test_migration.py (3/3 pass), plus preview and --apply against a temporary SQLite backup of ~/.maka/application/host (1 legacy model_requested event and 6 source prefix rows migrated cleanly, second run reported 0 remaining records, PRAGMA integrity_check returned ok).

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Antigravity — root-cause investigation, per-record Recall/catalog fault isolation, workbench UiScope/ApplicationHost rebinding and stream reconnection, tests, documentation updates, and the offline data migration Gist.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

…tired UI watches

Isolate per-record JSON/metadata decode errors in EventLog transcript/recall maintenance, RootStore session catalog outcome pagination, and agent-native Recall/catalog queries so historical records written under an earlier schema surface as Recall gaps or skipped catalog entries without breaking healthy sessions or introducing legacy decoders.

Reset Client::binding_retired after owned-session refreshes, refresh stale UiScope/ApplicationHost bindings on read-only queries and subscriptions, and reconnect persistent workbench observation loops cleanly across service activation handoffs without flashing browser refresh errors.

Historical local records can be migrated offline via the Python 3 stdlib script linked in the PR.

Generated-by: Antigravity
@M4n5ter
M4n5ter force-pushed the fix/recall-and-rebind-resilience branch from 421c92e to 63d7770 Compare November 5, 2026 02:50
@M4n5ter
M4n5ter merged commit ed79386 into rust-preview Nov 5, 2026
1 check passed
@M4n5ter
M4n5ter deleted the fix/recall-and-rebind-resilience branch November 5, 2026 02:51

@Astro-Han Astro-Han 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.

Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.

This is a focused follow-up on the terminal-list reconnection change at 63d7770f2d43f868c8ce0f916e03adae65ca9fe5.

P2: the new Stream<unknown> annotation breaks the product UI typecheck. It erases the typed watchList result before completed(outcome) and the subsequent resources/nextOffset access. The generated workbench UI check reports TS2345 at terminalState.ts:182 and TS18046 at lines 183–184. Preserve the stream's completion/result type across reconnects rather than widening it to unknown.

I checked the actual diff, the local Stream<T> and completed<T> definitions, and the hosted product logs. The parent 24d8efc6 passes the same generated UI typecheck in job 127001763523. After this merge, job 127020024355 fails with the three errors above; current rust-preview at 390360d0a3b4e9c605b1c3b895c79cb408f7cf49 still fails identically in job 127048365878. The affected file is byte-identical between this PR and the current branch.

I have not completed an independent review of the other Recall/rebinding changes, the offline migration script, or native recovery behavior, and I did not build the Rust/UI workspace locally. This finding concerns the confirmed product check regression.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

await host.query('terminal', 'list', { sessionId: session, offset }),
);
for (let reconnects = 0; current(); ) {
let opened: Stream<unknown> | null = null;

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] Keep the typed terminal completion stream across reconnects

Widening opened to Stream<unknown> discards the return type of host.subscribe('terminal', 'watchList', ...). After opened.next(), completed(outcome) no longer receives its required completed/failed union, and its result has no known resources or nextOffset. The normal generated workbench UI typecheck now fails with TS2345 at line 182 and TS18046 at lines 183–184. The parent product check passes; both the merge and current Rust branch fail at this same file. Retain an appropriately typed completion stream when adding the reconnect loop.

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.

Fixed by #6641. I checked the scoped const opened change and the successful product job 127128784359 at a98b7d485b2dcbd3ca0d8ffc89acc074627e8e0b: its actual log includes generation of the complete workbench ui_types project followed by a successful TypeScript check. This is more than the separate SDK acceptance check. The corrected terminalState.ts blob is unchanged in current Rust 06e9852cf961c6b617abcc4b8cecfdd3b2d31f4f.

This clears this type-check regression; it does not establish completion of the other Recall, reconnect or offline migration verification in #6638, or success of the entire current CI run.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

M4n5ter added a commit that referenced this pull request Nov 5, 2026
…efresh worker labels

- Remove the hardcoded MAX_PAGES = 16 limit in assembleChildren and rely on visited continuation cursors so long-lived Bots do not truncate child sessions.
- Reconnect createBotWorkers on observation cancellation (#6638) and skip continuation reads when the catalog revision is unchanged.
- Read entry() reactively for BotWaiting and BotReply with a stable waiting key, pass the current-pane fallback to createMessageSenders, and use worker-specific visible copy as accessibilityLabel.

Generated-by: Antigravity
M4n5ter added a commit that referenced this pull request Nov 5, 2026
Refs #6504. Let the user reach a Bot's workers directly from its Chat without introducing additional stored state:

- Link worker-triggered Bot replies (`origin: bot_worker`) to the worker's execution record, resolving worker titles and existence through `createMessageSenders` (archived included) and rendering the wake `SenderBadge` in Trajectory.
- Subscribe to the Host's `agent.catalog` child stream (`scope: children`) for the current visible Bot, following continuation cursors across pages and reconnecting across observation cancellations (`#6638`).
- Show running and waiting workers at the end of the Bot's Chat (waiting first) with live reactive title updates and distinct per-worker accessible labels.
- Open workers in a side pane when one fits, falling back to the current pane on narrow layouts, open preview panels, or terminal TUI.

Generated-by: Claude Code
Generated-by: Antigravity
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants