Skip to content

feat: an opencode session can rename a lich card - #19

Merged
omartelo merged 1 commit into
mainfrom
rename-session
Aug 22, 2026
Merged

omartelo merged 1 commit into
mainfrom
rename-session

Conversation

@omartelo

Copy link
Copy Markdown
Collaborator

lich grew a rename outside the window — lich rename, plus a rename_session MCP tool (lichdotdev/lich#343). Claude Code, Codex, Crush and omp are handed lich's own server and get that tool on the next spawn. opencode cannot register an MCP server from a plugin, so it defines each tool here — which makes this the one place a new tool has to be written twice.

What is new

rename_session, the eighth tool, the same shape as the other seven: an argv and nothing else, so every refusal and every wording stays upstream in docs/cli.md.

rename_session({ session: "auth-fix", label: "the login bug" })  →  lich rename auth-fix "the login bug"
rename_session({ label: "planner" })                             →  lich rename planner

The target is positional and optional, so it is dropped rather than sent empty: lich rename "" x would look for a session named "", where one argument is the new name for the session the agent is running in. That one-argument form is the one an agent actually has — list_sessions shows it every session but its own.

Test plan

  • node --test tests/*.test.mjs — 160 pass. New: the argv for all three forms (target, no target, target behind --project), and rename_session added to the registered-tool set the suite pins.
  • Needs lich 0.40.0 or newer; on an older lich the tool answers with that binary's own "not a command" line, which is the same way every other tool reports a refusal.

lich grew a rename outside the window — `lich rename`, plus a
`rename_session` MCP tool. Every other harness is handed lich's own server
and gets that tool on the next spawn; opencode defines each one here, so it
is the one place a new tool has to be written twice.

Eighth tool, same shape as the rest: an argv and nothing else. The target is
positional and optional, so it is dropped rather than sent empty — one
argument is the new name for the session the agent is running in, which is
the form an agent has, since list_sessions shows it every session but its own.
@omartelo
omartelo merged commit 0348162 into main Aug 22, 2026
2 of 3 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