Add new HTTP endpoints to the pi-mono gateway for companion-cloud web app integration:
- GET /models, POST /sessions/:key/model - model listing and switching
- GET /config, POST /config - settings read/write with redacted secrets
- GET /sessions/:key/history - conversation history as UI-friendly parts
- PATCH /sessions/:key, DELETE /sessions/:key - session rename and delete
- GET /channels/status, GET /logs, POST /sessions/:key/reload - ops endpoints
- Enhanced GatewaySessionSnapshot with name, lastMessagePreview, updatedAt
- Added log ring buffer (1000 entries) for /logs endpoint
- Add messageId to start chunk (required by useChat)
- Remove undocumented tool-output-error wire type, use
tool-output-available for all tool results
- Pass structured tool output through instead of JSON-stringifying
Tests cover extractUserText with v5+ parts format, v4 content string,
last-user-message extraction, simple text/prompt fields, null cases, and
preference ordering. Stream listener tests verify text event translation
and the writableEnded guard.
Map thinking_start/delta/end to Vercel AI SDK reasoning-start/delta/end
chunk types. Derive finish reason from enqueueMessage result - aborted
sessions get a clean finish with reason "error" instead of an error chunk.
Extend the Vercel stream listener to handle toolcall_start,
toolcall_delta, toolcall_end, and tool_execution_end events.
Maps to tool-input-start, tool-input-delta, tool-input-available,
and tool-output-available/tool-output-error Vercel SDK chunk types.
New POST /sessions/:key/chat endpoint that speaks the Vercel AI SDK
UI message SSE protocol (x-vercel-ai-ui-message-stream: v1). Accepts
both useChat format ({ messages: UIMessage[] }) and simple gateway
format ({ text: string }). Streams text-start, text-delta, text-end
events through the existing session infrastructure.
Add configurable initial filter mode for the session tree navigator.
Users who always switch to a specific filter (e.g. no-tools via Ctrl+T)
can now set it as default in settings.
Same pattern as doubleEscapeAction (#404). Filter infra from #747.
Use visibleWidth/truncateToWidth for footer path and stats truncation so wide Unicode text cannot overflow terminal width.
Add regression tests for wide session/model/provider names and document the fix in changelog.
closes#1833