Skip to content

fix(workbench): start the Bot outbox watch when the identity is answered late - #6503

Merged
M4n5ter merged 1 commit into
rust-previewfrom
fix/bot-late-identity
Oct 31, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
fix/bot-late-identity

Conversation

@liugddx

@liugddx liugddx commented Oct 31, 2026

Copy link
Copy Markdown
Member

What

Follow-up to #6464, addressing the remaining P2 from Astro-Han's review there.

If every Bot identity lookup failed, the transcript's startup ended without subscribing. A later answer from the application (botSession) would then make identity() report bot, but nothing ever started the outbox watch, so Bot replies stopped appearing until the pane was reopened.

Change

  • botTranscriptCore.ts: the startup is now a restartable run(). When the identity is still unresolved, identity() / isBot() call resume(), which starts the watch once the application's answer says this Session is the Bot. It never restarts after an identity was resolved, so a finished watch does not loop.
  • bot-transcript.test.mjs: new test where all lookups fail, then the application answers bot, and the outbox subscription must start. It fails without the fix and passes with it.

Verification

  • node --test products/maka/workbench/tests/bot-transcript.test.mjs: 12 pass (the new test fails on the previous code).
  • biome check on the two files: clean.

Not covered: this was checked with the transcript tests only, not in the running desktop app.

🤖 Generated with Claude Code

…red late

When every identity lookup failed, the transcript ended unstarted. A later
answer from the application then reported the Session as the Bot but never
subscribed, so replies stopped appearing until the pane was reopened. The
watch now starts as soon as the application's answer says this is the Bot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

I reviewed both changed files at e68b9d2975f8328cd4c54cd636995cb973c10e10 and the reactive wrapper/Conversation consumer. The previously reported P2—an application answer identifying the Bot after all lookup retries had ended, without starting its outbox subscription—is fixed in the controlled production-core checks. I found no confirmed new P0–P2 defect within that scope.

All 12 repository transcript tests passed. I also reran the three-check reproduction used for the earlier report against this exact core: the late application answer now opens one subscription and displays the recorded SendUser reply, alongside the fresh-core and ordinary-Session controls. Five additional controlled lifecycle checks passed for the isBot() entry point, repeated getter calls without duplicate subscriptions, ordinary identity, closure before or during resumed opening, and a watch ending without being reopened by later reads. The new repository regression fails with the unchanged target's old core (11 pass, 1 fail); the earlier three-check reproduction also still fails with that old core (2 pass, 1 fail).

The change makes startup restartable while identity is unresolved, retains a single running attempt and prevents identity reads from reopening a watch after Bot identification. The application wrapper reads the known-Session signal, so a later answer causes the relevant getters to be evaluated. These tests use the unchanged production core with controlled Host/query/stream/wait adapters. I did not run a real Host, native desktop, or Rust suite; this does not establish native rendering or restart acceptance. No wire or database migration changes.

P3, contribution metadata: the current commit discloses Claude through Co-Authored-By, but has no Generated-by: trailer. CONTRIBUTING.md requires that trailer for material AI-authored commits; please add and preserve it in the final commit. This is a process issue, not a runtime finding.

The actual merge into rust-preview@dfc0e232370fd29447d01570273c8a541bc902aa succeeds without conflicts. PR CI 41203377520 failed on the inherited browser.rs:789 Clippy warning, not on a transcript test. That browser source is unchanged by this PR. The current target separately fixes that warning, but this PR run does not validate the merged result; the full required check remains red and its later integration job was skipped. The target still contains the old transcript core until this change is merged.


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
M4n5ter merged commit 4f2213c into rust-preview Oct 31, 2026
1 of 2 checks passed
@M4n5ter
M4n5ter deleted the fix/bot-late-identity branch October 31, 2026 15:15
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.

3 participants