Skip to content

Use first user prompt for web history conversation titles#103

Draft
nmaguiar wants to merge 1 commit intomainfrom
codex/display-first-message-in-history-list
Draft

Use first user prompt for web history conversation titles#103
nmaguiar wants to merge 1 commit intomainfrom
codex/display-first-message-in-history-list

Conversation

@nmaguiar
Copy link
Contributor

@nmaguiar nmaguiar commented Feb 15, 2026

Motivation

  • History list titles were drifting to later prompts in an ongoing conversation, making entries less representative of the original user request.
  • Keep history titles stable and meaningful by using the conversation's first user prompt when available.

Description

  • Added extractFirstUserPromptFromEvents(events) to return the first 👤/user message from saved conversation events.
  • Updated history rendering in refreshHistoryPanel to derive title from the first user prompt (with safe fallbacks to entry.prompt, entry.title, or 'Conversation').
  • Updated addConversationToHistory to anchor stored prompt/title to the first user prompt when present so persistence no longer overwrites the canonical title with later prompts.

Testing

  • Verified code changes and locations with rg searches for the new helper and title derivation in public/index.md and inspected the git diff for the file. (succeeded)
  • Attempted to run repository tests with ojob tests/miniAUtils.yaml but the ojob command is not available in this environment (failed to run automated tests).
  • Served the web UI with python3 -m http.server 8000 from public/ and captured a UI screenshot using a Playwright script to validate the history panel rendering, producing an artifact at browser:/tmp/codex_browser_invocations/.../artifacts/artifacts/history-title-change.png (succeeded).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant