Skip to content

fix(omp): report the conversation a /resume switches to - #84

Merged
omartelo merged 1 commit into
mainfrom
feat/omp-session-switch
Oct 17, 2026
Merged

omartelo merged 1 commit into
mainfrom
feat/omp-session-switch

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

A /resume inside omp switches the session to another conversation without a second session_start, so lich kept the id the card opened with: a restart resumed the old conversation, and lich's two-cards-one-conversation warning (lich#799) never reached omp.

What changes

  • omp/lich.js reports session-start on session_switch as well, through the same handler as session_start. By the time session_switch fires, ctx.sessionManager.getSessionId() already answers with the new id.
  • Every reason is reported: the contract asks for the conversation running in the card now, whatever moved it there.

Measured, not read off a type

omp 18.8.9, a logger extension loaded with -e and --no-extensions, two fabricated sessions:

session_start          reason=undefined id=…0A
input                  reason=undefined id=…0A
session_before_switch  reason=resume    id=…0A
session_switch         reason=resume    id=…0B

Verification

  • New test session_switch reports the conversation switched to, red before the change; node --test tests/*.test.mjs 434/434.
  • Same endpoint and payload lich already accepts, so a patch release (0.20.5) by the release rule. Once a lich release installs it, lich's docs/ceilings.md and README provider row move omp to "warned at the switch".

A /resume inside omp moves the session onto another conversation without a
second session_start: omp emits session_switch instead (reason "resume",
measured on 18.8.9 with a logger extension), with the session manager
already on the new id. The client now reports session-start on it too, so
lich holds the conversation the card runs and can warn when another card
runs it as well.
@omartelo
omartelo merged commit f2366db into main Oct 17, 2026
2 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