Skip to content

Add lich whoami and accept a session id as a target - #700

Merged
omartelo merged 2 commits into
mainfrom
feat/session-own-label
Oct 9, 2026
Merged

omartelo merged 2 commits into
mainfrom
feat/session-own-label

Conversation

@omartelo

@omartelo omartelo commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

A session could not learn its own label: lich sessions and list_sessions leave the caller out, and a lich id passed as a target answered "no session named". lich-plugin (lichdotdev/lich-plugin#62) works around it by matching the text of control's self-refusal, which has no contract.

  • lich whoami [--json] (RPC relay.Self): the caller's own entry, same object as sessions --json (label, name, project, kind, state, id). Errors when LICH_SESSION_ID is unset or unknown.
  • Both resolvers (relay.resolve for send, spawn.findSession for close/rename/control/ask/file) match the lich id before the label and roster name, honouring --project. Naming yourself by id gets what naming yourself by label gets: control and ask still refuse, send still finds no live session.
  • Contract in docs/cli.md, MCP param descriptions mention the id, CHANGELOG entry.

Provider-agnostic: LICH_SESSION_ID is set for every provider's PTY, so no provider gap.

Gate: gofmt, go vet ./..., go test ./... green. Frontend untouched.

A session had no way to learn its own label: sessions and list_sessions
leave the caller out, and a lich id given as a target matched nothing.
whoami prints the caller's own entry in the sessions shape, and both
resolvers (relay and spawn) now match the id before the two names, so
naming yourself by id gets the same answer as naming yourself by label.
@omartelo
omartelo merged commit 7194fd4 into main Oct 9, 2026
7 checks passed
@omartelo
omartelo deleted the feat/session-own-label branch October 9, 2026 18:42
@omartelo omartelo mentioned this pull request Oct 9, 2026
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