Repository navigation
Closed
Labels
Description
What problem does this solve?
Two session actions of the TUI have no route in tole serve, so a graphical client cannot offer them:
- Rename (
/name <text>): sets thefact/session_nameregister, shown bysessions --alland used bytole resume <name>. - Compact (
/compact): the next prompt compacts first (the forced pass of compaction: the fleet gateway reports no context window, so compaction is silently off; no overflow recovery #481). It is not a mid-turn compaction, and instructions are not supported yet (docs/tui.md).
Found while writing the screen inventory for #561 (screen 9, gaps D and E). They are small and write registers that already exist, so they are one issue and one PR.
Proposed solution
Two routes, behind the existing bearer token, refused while a turn runs (the TUI refuses commands then, because they need the session lock):
POST /sessions/{id}/name {"name": "<text>"}: writesfact/session_name. Same rules as/name: trimmed, a length cap, control characters rejected (the name is shown in lists and terminals).400for a blank or invalid name.POST /sessions/{id}/compact {}: sets the forced-compaction flag the TUI's/compactsets, so the next prompt compacts first. No body fields (instructions stay unsupported and are not accepted, so a client cannot believe they were applied).- Both:
404for an unknown session,409while a turn is running,401without the token. Corrections are new register entries (the log stays append-only).
Alternatives considered
- Let clients rewrite the register through some generic write route: a general write route is a much larger surface than two named actions.
- Skip compact: the footer shows context use, so a user who sees the window filling needs a way to act on it.
Acceptance criteria
-
POST …/namesets the name;sessions --allandtole resume <name>see it; a blank name, an over-long name and a name with control characters are refused (tests). -
POST …/compactmakes the next prompt compact first, covered by a test on the provider requests (the compaction call precedes the prompt), and clears the flag afterwards. -
409while a turn runs,404for an unknown session,401without the token; each has a test. -
docs/mobile-control.mdand the CHANGELOG are updated in the same PR.
Activity
docs: serve and acp accept --skill and --mcp-server; UI stack row fol…