Skip to content

Chat UI: accept canonical main session key alias#20311

Merged
mbelinky merged 2 commits intomainfrom
mb/pr-chat-main-session-alias
Feb 18, 2026
Merged

Chat UI: accept canonical main session key alias#20311
mbelinky merged 2 commits intomainfrom
mb/pr-chat-main-session-alias

Conversation

@mbelinky
Copy link
Contributor

@mbelinky mbelinky commented Feb 18, 2026

Summary

  • treat canonical main session-key alias as equivalent in ChatViewModel
  • add/adjust tests to cover alias handling and avoid A2UI waiting-state mismatch

Testing

  • not run in this PR prep flow

Greptile Summary

Fixes a bug where the Chat UI's ChatViewModel would silently drop external-run completion events when the gateway published the canonical session key "agent:main:main" but the UI was initialized with the short alias "main". This caused the UI to miss history refreshes from runs completed by other clients or agent surfaces.

  • Extracts session key comparison into a new matchesCurrentSessionKey static method in ChatViewModel.swift that normalizes and compares keys, with a special-case bidirectional alias match for "main""agent:main:main" — consistent with how the TypeScript UI already handles this in app-render.helpers.ts
  • Adds acceptsCanonicalSessionKeyEventsForExternalRuns test covering the fix, and an acceptsCanonicalSessionKeyEventsForOwnPendingRun test documenting that own-run events already bypassed the session key guard via the isOurRun flag

Confidence Score: 5/5

  • This PR is safe to merge — it's a targeted bug fix with good test coverage and no risky side effects.
  • The change is narrow and well-scoped: it replaces a raw string inequality check with a method that also handles a known alias pair. The alias pattern is already established in the TypeScript codebase. The new static method is pure (no side effects), the guard logic is preserved, and the test directly exercises the fixed scenario. No regressions are expected.
  • No files require special attention.

Last reviewed commit: 8a45e9a

@openclaw-barnacle openclaw-barnacle bot added size: S maintainer Maintainer-authored PR labels Feb 18, 2026
@mbelinky mbelinky force-pushed the mb/pr-chat-main-session-alias branch from 8a45e9a to a4ed523 Compare February 18, 2026 19:41
@mbelinky mbelinky merged commit fe3f075 into main Feb 18, 2026
10 checks passed
@mbelinky mbelinky deleted the mb/pr-chat-main-session-alias branch February 18, 2026 19:42
@mbelinky
Copy link
Contributor Author

Merged via squash.

Thanks @mbelinky!

anschmieg pushed a commit to anschmieg/openclaw that referenced this pull request Feb 19, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: a4ed523
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
HenryChenV pushed a commit to HenryChenV/openclaw that referenced this pull request Feb 20, 2026
Merged via /review-pr -> /prepare-pr -> /merge-pr.

Prepared head SHA: a4ed523
Co-authored-by: mbelinky <[email protected]>
Co-authored-by: mbelinky <[email protected]>
Reviewed-by: @mbelinky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments