Skip to content

Add Up/Down replay for user input history#4349

Merged
SivanCola merged 1 commit into
esengine:main-v2from
ferstar:codex/4348-prompt-history-tape
Jun 14, 2026
Merged

Add Up/Down replay for user input history#4349
SivanCola merged 1 commit into
esengine:main-v2from
ferstar:codex/4348-prompt-history-tape

Conversation

@ferstar

@ferstar ferstar commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a new Up/Down replay feature for user input history in the desktop composer
  • back prompt history with a lazy cursor tape: active session first, then sidebar/session sidecar order, with JSONL parsing only when a session is reached
  • prefer user-visible persisted prompt text through session display sidecars and skip synthetic user messages
  • add backend/frontend regression coverage for replay, pagination, session ordering, display text, and empty-session traversal

Closes #4348

Related contribution

Thanks @PsjJourney for #3648. That PR helped define the desktop composer UX for this feature:

  • established plain Up/Down as the expected keyboard entry point for prompt history replay
  • explored preserving the in-progress draft while moving through recalled prompts
  • kept the behavior scoped to composer keyboard handling instead of adding a separate history UI

This PR carries that UX direction forward with a backend-backed lazy session tape, persisted user-visible prompt text, active-session-first traversal, cross-session ordering, and broader regression coverage.

Authorship note: @ferstar is the primary author of this PR. @PsjJourney contributed the earlier composer Up/Down history UX exploration in #3648. @SivanCola contributed the rebase/conflict resolution, contributor attribution, and final verification.

Verification

  • go test ./...
  • go test ./... in the desktop module
  • pnpm --dir desktop/frontend test
  • git diff --check

@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) agent Core agent loop (internal/agent, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 14, 2026
@ferstar ferstar changed the title Fix lazy prompt history navigation Add Up/Down replay for user input history Jun 14, 2026
@ferstar ferstar force-pushed the codex/4348-prompt-history-tape branch 3 times, most recently from f7b9ca1 to aa08682 Compare June 14, 2026 04:15
@github-actions github-actions Bot added mcp MCP servers / plugins (internal/plugin, codegraph) config Configuration & setup (internal/config) labels Jun 14, 2026
@ferstar ferstar force-pushed the codex/4348-prompt-history-tape branch from 2725797 to 2c82301 Compare June 14, 2026 10:06

@SivanCola SivanCola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, this is directionally right. The backend-backed lazy tape is a better fit for #4348 than a frontend-only history buffer, and it also looks like the more complete path compared with the overlapping #3648.

Before merging, please rebase on the latest main-v2 and resolve the current conflicts:

  • desktop/frontend/package.json needs to preserve both the existing font/typography tests from main-v2 and the new composer history/keyboard tests from this PR.
  • desktop/frontend/src/components/Composer.tsx needs to be resolved against the latest composer changes.

I did not find a provider-prefix/cache risk in this PR: the new code reads persisted session logs for UI replay and does not change provider request serialization, system prompts, or tool schemas.

Once this is addressed and CI stays green, I will consider merging it into main-v2.

Verified on the current PR head before rebase:

  • go test ./... passed
  • go test ./... in the desktop module passed
  • pnpm --dir desktop/frontend test passed
  • git diff --check passed

Closes esengine#4348

Co-authored-by: PsjJourney <14682492+PsjJourney@users.noreply.github.com>

Co-authored-by: SivanCola <32437197+SivanCola@users.noreply.github.com>

@SivanCola SivanCola left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. I rebased the PR onto the latest main-v2, resolved the composer/package conflicts, and pushed the fix as bc76beab.

What changed after the previous review:

  • desktop/frontend/package.json now preserves the existing font/typography tests from main-v2 and adds the new composer history/keyboard tests.
  • desktop/frontend/src/components/Composer.tsx is resolved against the latest composer code while keeping the prompt-history navigation behavior.
  • The commit metadata now uses GitHub noreply identities and credits @PsjJourney for the earlier #3648 composer Up/Down history UX exploration.
  • The PR body now documents #3648's contribution points and authorship note.

Verified:

  • go test ./... passed
  • go test ./... in the desktop module passed
  • pnpm --dir desktop/frontend test passed
  • git diff --check passed

@SivanCola SivanCola enabled auto-merge June 14, 2026 13:01
@SivanCola SivanCola merged commit 6483721 into esengine:main-v2 Jun 14, 2026
14 checks passed
@ferstar

ferstar commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

Just a historical note: the core design of this feature — cursor-based lazy JSONL tape, nonce+cache invalidation, cross-session ordering — was first implemented in PR #2068 (TypeScript, merged into main on May 29). That PR established the persistence mechanism through session JSONL logs, the cursor-based older/newer navigation sidecar, cache invalidation on session metadata changes, and duplicate-prompt preservation. The Go rewrite (#4349) is a port and evolution of the same design for the main-v2 architecture.

I don"t need any attribution changes — just wanted to leave a reference for anyone tracing the history of this feature later.

@ferstar ferstar deleted the codex/4348-prompt-history-tape branch June 14, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) mcp MCP servers / plugins (internal/plugin, codegraph) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Up/Down replay for user input history

2 participants