Skip to content

Add chat navigation from console prompt history - #1743

Merged
gjkim42 merged 1 commit into
mainfrom
console-prompt-history-navigation
Sep 10, 2026
Merged

Add chat navigation from console prompt history#1743
gjkim42 merged 1 commit into
mainfrom
console-prompt-history-navigation

Conversation

@gjkim42

@gjkim42 gjkim42 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds Jump to message to each entry in the console's Prompt history. Selecting it loads earlier transcript pages as needed, closes the dialog, and scrolls to and focuses the matching message. Closing the dialog cancels navigation.

Matches retained messages by event ID and includes the turn ID in prompt responses so queued and edited messages remain navigable. Documents the action and covers loaded messages, pagination, duplicate text, attachments, pending messages, cancellation, and errors.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

  • Validation: make update, env -u CODEX_HOME -u CODEX_AUTH_JSON make test TEST_FLAGS=-count=1, and make verify.
  • The unit test environment excludes agent-session Codex settings because existing entrypoint tests inherit them.
  • Console e2e coverage uses the browser's bounded history subscription, verifies that projected history was returned, and matches prompt IDs and text to projected transcript messages. E2e execution runs in PR CI.

Does this PR introduce a user-facing change?

The console's Prompt history now lets you jump directly to a message, loading earlier conversation history as needed.

Summary by cubic

Adds "Jump to message" to each entry in the console's Prompt history. Prompt history previously only offered Copy text and Use text; now you can navigate straight to the prompt's message in the conversation, loading earlier transcript pages as needed.

  • Selecting the action closes the dialog and scrolls to and focuses the matching message.
  • Closing the dialog cancels navigation while messages are loading.
  • Prompt responses now include the turn ID, so queued and edited messages stay navigable.
  • Updates the documentation and adds coverage for loaded messages, pagination, duplicates, attachments, pending prompts, cancellation, and errors.

Written for commit 02d164f. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added kind/feature Categorizes issue or PR as related to a new feature needs-triage needs-priority needs-actor release-note labels Sep 10, 2026
@gjkim42

gjkim42 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

/kelos claude-review

@kelos-bot

kelos-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🤖 Kelos Task Status

Task kelos-claude-reviewer-issue-comment-740d9acd4e57 has succeeded. ✅

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

Re-trigger cubic

@kelos-bot

kelos-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🤖 Kelos Claude Reviewer Agent @gjkim42

Review Summary

Verdict: APPROVE
Overall correctness: patch is correct
Scope: Adds a "Jump to message" action to the console's Prompt history that scrolls to and focuses the matching transcript row, auto-loading older history pages until found; adds turnId to prompt responses so live-edited and queued messages can be matched.

Findings Overview

Priority Count File:Line Summary
P0 0 none
P1 0 none
P2 0 none
P3 1 test/e2e/session_test.go:182 e2e asserts against raw journal events, not the projected transcript the console renders

Findings

Tests

  • [P3] test/e2e/session_test.go:182-186 — The PR notes say this verifies that prompt IDs "match transcript messages", but the subscribe request here omits HistoryBounds, so the server takes the journal.Subscribe branch (internal/sessionruntime/server.go:1594) and retainedPrompts holds raw journal events. The console subscribes with historyBounds: true, where projectHistory re-emits each turn's user message with the first event ID and normalizedHistoryEvent strips TurnID (history.go:196-200, history.go:425). That first-event-ID rule is exactly what continuePromptJump relies on for history-replayed rows (row.dataset.eventId === String(prompt.id)), and this e2e cannot catch a regression in it. Consider subscribing with HistoryBounds: true plus item/byte limits and keeping only the HaveKey(prompt.ID) assertion (the TurnID equality would need to go since projection clears it), or reword the note to say it checks the raw-journal path.

Key takeaways

  • Matching logic is sound for all three row sources: history-replayed rows carry the first event ID (projection re-IDs edited turns and strips turnId), live-accepted rows carry the latest event ID plus turnId, and pending cards match by turnId. promptHistoryItems and projectHistory hide the same set of turns (removed/merged), so the page-loading loop terminates on the target rather than walking the whole journal.
  • Cancellation paths are covered: closePromptHistory clears the target and is reached from dialog close/cancel, closeSocket, the socket close handler, and resetCurrentSessionView; cancelOlderHistoryPage surfaces page errors and send failures back into the dialog status.
  • Frontend unit tests cover loaded/duplicate/attachment-only rows, in-flight page reuse, pending and edited-pending targets, waiting for the initial replay, four cancellation entry points, and unavailable/page-error/send-error outcomes. Docs, web/app.js, and the PR template are all in sync with the change.

@gjkim42
gjkim42 force-pushed the console-prompt-history-navigation branch from 7f4a860 to 02d164f Compare September 10, 2026 13:40
@gjkim42
gjkim42 added this pull request to the merge queue Sep 10, 2026
Merged via the queue into main with commit b433986 Sep 10, 2026
23 checks passed
@gjkim42
gjkim42 deleted the console-prompt-history-navigation branch September 10, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature needs-actor needs-priority needs-triage release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant