Skip to content

fix(miniapp): preserve research and isolate topic sessions - #3317

Merged
bobleer merged 5 commits into
GCWing:mainfrom
bobleer:bob/miniapp-research-and-topic-sessions
Oct 9, 2026
Merged

bobleer merged 5 commits into
GCWing:mainfrom
bobleer:bob/miniapp-research-and-topic-sessions

Conversation

@bobleer

@bobleer bobleer commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Keep MiniApp context as reference material for independent research, and make topic creation/restoration retain the correct conversation. Supplied files now point the Agent to exact per-turn paths without encouraging a field-by-field report or limiting available WebSearch/WebFetch tools.

MiniApp topic switches keep the selected dock position, wait for restored history, retry failed hydration, and reject messages delivered for an old session. PPT Live shares concurrent initialization for one topic, creates a separate session for a new topic, and preserves saved history references when restoration fails. Its bundled version is updated to 261.

Type and Areas

Type: bug fix / regression fix.

Areas: MiniApp contracts and SDK, desktop adapter, Web UI conversation routing, bundled PPT Live, documentation and regression tests.

Motivation / Impact

Starting a new PPT topic could race session initialization and move the floating conversation to an unrelated app. Restoring a missing session could silently replace its history pointer with an empty conversation. New topics now get their own session/workspace, while existing topics either restore their original conversation or report a retryable error.

The SDK adds app.agent.createSession(options) through the existing agent.ensureSession operation with no session ID. Context-enabled market Agents retain research tools and their existing read-only file scope.

Verification

CI run 37889161568 succeeded for 6945487abaf917a873826fe88e63036ec61b4d3e. All 11 completed PR checks passed; the 2 impact-gated packaging jobs were skipped by the existing workflow rules.

The macOS and Linux desktop library suites executed and passed. The existing Windows desktop probe compiled the test executable but hit the known Tauri loader limitation (0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND) before any desktop tests ran. The workflow reports that limitation as a warning; the remaining Windows checks passed.

Passed locally:

  • pnpm run fmt:rs and git diff --check.
  • pnpm run check:web (SDK, appearance/theme contracts and TypeScript).
  • pnpm run test:ppt-live — 199 tests.
  • cargo check --locked -p openbitfun-desktop --lib — passed with existing warnings.
  • cargo test --locked -p openbitfun-desktop --lib api::miniapp_agent_api::tests — 10 tests, including the exact untrusted-context instruction contract.
  • cargo test --locked -p openbitfun-product-domains --no-default-features --features miniapp --lib miniapp::agent_bridge::tests — 7 tests.
  • cargo test --locked -p openbitfun-product-domains --no-default-features --features miniapp --test miniapp_contracts — 39 tests.
  • cargo test --locked -p openbitfun-agent-tools --no-default-features --lib miniapp_run_restrictions_follow_the_runtime_profile_of_the_turn — 1 test.
  • pnpm run i18n:audit and pnpm run theme:color-audit:all.
  • node scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD — within policy.
  • Focused Web UI routing/lifecycle tests — 86 passed; MiniApp API and peer adapter contracts — 58 passed.
  • pnpm --dir src/web-ui exec vitest run src/app/scenes/miniapps/hooks/useMiniAppBridge.test.tsx src/flow_chat/components/toolbar-mode/toolbarModeSessionSurface.test.ts — 31 tests after replacing the old source-text hydration assertion with a bridge behavior test.
Focused frontend commands
pnpm --dir src/web-ui exec vitest run src/app/scenes/miniapps/hooks/useMiniAppBridge.test.tsx src/app/scenes/miniapps/miniAppConversation.test.ts src/app/scenes/miniapps/miniAppComposerMessages.test.ts src/app/services/sessionSceneLifecycle.test.ts src/flow_chat/services/sessionActivation.test.ts src/flow_chat/services/storeSync.test.ts src/app/stores/sceneStore.test.ts
pnpm --dir src/web-ui exec vitest run src/infrastructure/api/service-api/MiniAppAPI.test.ts src/infrastructure/api/adapters/peer-device-adapter.test.ts

Reviewer Notes

  • No new Tauri command, peer capability or wire operation. Existing payloads remain valid, and saved topic shapes are unchanged. An explicitly requested session that no longer exists now returns an error instead of creating a replacement.
  • Local tests exercise delayed session creation, history-load failure/retry, old-topic message rejection, legacy references and peer capability contracts. No live remote workspace, mobile/IM remote control, peer device or detached dispatch environment was exercised; there is no claim of full desktop E2E coverage.
  • The separately managed Market Lens marketplace package is outside this repository; this PR contains the shared host/SDK and built-in PPT changes.
  • AI-assisted implementation, with focused automated verification and the CI matrix verified before merge.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 4af0e55 into GCWing:main Oct 9, 2026
13 checks passed
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.

1 participant