Skip to content

feat: show prompts for opencode and codex sessions#25

Open
erickgnclvs wants to merge 1 commit into
mainfrom
cowsay
Open

feat: show prompts for opencode and codex sessions#25
erickgnclvs wants to merge 1 commit into
mainfrom
cowsay

Conversation

@erickgnclvs
Copy link
Copy Markdown
Owner

Summary

  • Add ForAgent() dispatcher in the prompt package that routes to the right data source based on agent type (opencode → OpenCode SQLite DB, codex → Codex threads table, claude → existing JSONL reader)
  • Add FirstOpenCode(): queries ~/.local/share/opencode/opencode.db joining part + message + session to find the first user text prompt for a given directory
  • Add FirstCodex(): reads first_user_message from the threads table in Codex state SQLite files — handles both OpenAI CLI (~/.codex/state_*.sqlite) and JetBrains plugin (~/Library/Caches/JetBrains/*/aia/codex/state_*.sqlite on macOS)
  • Fix caching bug in refreshPrompts(): empty prompt results were permanently cached (presence in map = skip), so a session never got its prompt updated after the first miss. Now only non-empty prompts are cached.

Test plan

  • Open moomux with an active opencode session — prompt should appear in the session list
  • Open moomux with a codex session — prompt should appear
  • Verify claude sessions still show prompts as before
  • Create a new session, send a message, confirm the prompt updates on the next poll tick

🤖 Generated with Claude Code

Add agent-aware prompt extraction so cowsay shows the first user
message for opencode (via opencode.db) and codex (via threads.first_user_message
in state SQLite files, covering both OpenAI CLI and JetBrains layouts).

Also fix a caching bug in refreshPrompts where sessions with an empty
prompt were permanently skipped — now only sessions with an already-found
prompt are cached, so the prompt appears as soon as the agent processes
the first message.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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