Status:
draft · Version 0.1 · Filed 2026-05-01Title: Codex Terminal Persona Label — use app-server thread names for in-terminal identity, not title-bar chrome
Version
0.1Status
draftProblem
Prism needs a Codex-visible persona marker comparable to the Claude Code statusline. The existingcoder launcher already writes the persona and project into the terminal/window title via OSC escape sequences, but that is terminal chrome, not content inside the Codex terminal UI. The operator explicitly asked for the persona name within the Codex terminal, not the window title bar, and noted that a related path worked before the SPEC-054 port/regression work.
The working distinction is:
- Title-bar watcher: outer terminal chrome, useful but insufficient.
- Codex app-server thread name: Codex-native, user-facing thread label rendered by the Codex TUI/app surfaces.
- Codex app-server
turn/steer/turn/start: inline dynamic notices in the conversation flow, suitable for signals and statusline simulation events.
Research Notes
Research was performed against installedcodex-cli 0.125.0 on 2026-05-01.
Findings:
codex --helpexposes--remote,--no-alt-screen, and app-server controls, but no documented--statuslineor footer customization flag.- Prism
bin/coder.shandbin/coder.ps1already set terminal/window title using OSC title escape sequences. That is not the requested in-terminal surface. codex app-server generate-json-schemaexposesthread/name/setwith params{ threadId, name }.- The generated schema describes thread
nameas an optional user-facing thread title. - A live app-server test against
ws://127.0.0.1:45650successfully set current thread019de107-4e85-7760-94cf-252a3b426fe0fromname=nulltoname="Texi · prism";thread/readconfirmed the result.
Goal
On Codex bootstrap, if an app-server URL and loaded thread are available, set the Codex thread name to a concise persona/project label:<PRISM_AGENT_IDENTITY> · <PRISM_PROJECT_NAME>
Example:
Texi · prism
This gives operators an in-terminal Codex identity label without relying on window-title chrome.
Non-Goals
- Do not remove the existing terminal-title watcher; it remains useful for OS/window/tab discrimination.
- Do not claim a general Codex footer/statusline API exists unless Codex exposes one.
- Do not put dynamic signal counts into the static thread name in v0.1.
- Do not route Prism FastAPI directly to Codex app-server.
- Do not expose Codex app-server off loopback.
Design
ExtendAppServerInjectStrategy with a non-fatal setThreadName(name) method.
Behavior:
- Discover thread id from
PRISM_CODEX_THREAD_ID,CODEX_THREAD_ID, orthread/loaded/list, following the existing strategy discovery path. - Call app-server method
thread/name/setwith{ threadId, name }. - Treat failure as non-fatal and keep Codex delivery on piggyback/app-server signal paths.
- Run this from
CodexSurface.onBootstrapafter strategy construction.
- Identity comes from bootstrap context
agentIdentityorPRISM_AGENT_IDENTITY. - Project name comes from
PRISM_PROJECT_NAME. - Fallback label is identity alone when project is missing.
- Empty or
Botidentities should not overwrite a useful existing thread name unless explicitly launched that way.
Operator-Visible Effect
Afterprism_start in a Codex session with app-server enabled, the Codex terminal/app thread label shows the Prism runtime identity and project, for example Texi · prism. This is distinct from the terminal title bar. Dynamic Prism signals still appear inline through turn/steer during active turns or turn/start when idle.
Acceptance Tests
- Fake app-server smoke: Codex bootstrap label path calls
thread/name/setwith the current thread id and expected name. - Fake app-server smoke: missing/no loaded thread is non-fatal and does not throw out of surface bootstrap.
npm run buildinmcp-nodesucceeds.- Live manual test: with Codex app-server running,
thread/readreportsthread.name = "Texi · prism"after bootstrap.
Open Questions
- Whether signal counts should later update the thread name, or remain only in inline signal messages and/or title chrome.
- Whether Codex will expose a first-class terminal footer/statusline API later; if so, that should replace or supplement the thread-name approach.
- Whether thread naming should be reset on wrap or left as useful session history.

