openclaw - ✅(Solved) Fix [Feature]: TUI, show a short recent-session summary on startup/history load [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#71719Fetched 2026-04-26 05:09:23
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
cross-referenced ×1labeled ×1

Show a short recent-session summary in the TUI after connection/history load so users can quickly recover working context when returning to an existing session.

Root Cause

Show a short recent-session summary in the TUI after connection/history load so users can quickly recover working context when returning to an existing session.

Fix Action

Fixed

PR fix notes

PR #71856: feat(tui): fetch startup conversation summary dynamically from Gateway API

Description (problem / solution / changelog)

  • Problem: The TUI startup summary was static and relied on a legacy environment variable (OPENCLAW_TUI_STARTUP_SUMMARY), making it outdated or requiring manual configuration.
  • Why it matters: Users should see their most recent conversation context automatically when opening the TUI for better continuity and DX.
  • What changed:
    • Updated src/tui/tui.ts to dynamically fetch the last 10 sessions via client.listSessions upon connection.
    • Implemented logic to identify the most recent active session (excluding the current one) and display its title or last message preview as the startup summary.
    • Added best-effort error handling to ensure TUI startup isn't blocked by API fetch failures.
    • Removed legacy static summary resolution logic from CLI and tests.
  • What did NOT change: The feature is skipped in isLocalMode to maintain local performance and prevent unnecessary API calls in local-only scenarios.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes # (Insert your issue number here)
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • N/A

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
  • Target test or file: src/cli/program.smoke.test.ts
  • Scenario the test should lock in: Tui command bootstrap and successful connection flow without static summary dependencies.

User-visible / Behavior Changes

When connecting to a Gateway, the TUI now automatically displays a "startup summary" derived from the most recent previous conversation (if any), showing either the derived title or a preview of the last message.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? Yes (One additional listSessions call performed during connection)
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: Node.js (OpenClaw TUI)
  • Model/provider: Gemini 3.1 Pro

Steps

  1. Run openclaw tui
  2. Observe the system message logs after connection.

Expected

  • Startup summary appears dynamically based on recent account history.

Evidence

  • Passing npm run build
  • Passing src/cli/program.smoke.test.ts
  • Verified via CLI log inspection.

Human Verification (required)

  • Verified scenarios: Successfully verified that the TUI fetches and displays the correct session summary from the Gateway API.
  • Edge cases checked: Verified that API timeouts or failures do not crash the TUI (handled via catch block).
  • What you did not verify: UI layout on extremely narrow terminals (< 40 chars).

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No (Removes reliance on an internal env var)
  • Migration needed? No

Changed files

  • src/tui/tui.ts (modified, +42/-0)
RAW_BUFFERClick to expand / collapse

Summary

Show a short recent-session summary in the TUI after connection/history load so users can quickly recover working context when returning to an existing session.

Problem to solve

When opening the TUI, it can be hard to immediately recover the latest working context, especially after stepping away for a while or returning to an existing session.

Today, the TUI loads history, but there is no concise “you were last working on X” style surface at startup.

This makes it harder to:

  • resume an interrupted session quickly
  • re-enter ongoing work after time away
  • keep context continuity visible in the terminal UI itself

Proposed solution

Add an optional startup summary block in the TUI that appears after connection/history load and gives a short recap of the most recent relevant conversation or session context.

Desired behavior:

  • when the TUI opens an existing session, show a short recent-context summary near the top of the visible startup flow
  • keep it brief, for example a few bullet points
  • make it visually distinct from normal chat history
  • avoid mixing it into transcript history in a confusing way
  • source it from a generic session/context mechanism rather than a hardcoded local file or workspace-specific path

Alternatives considered

  • Relying only on full history loading: works, but requires manual scrolling and reconstruction of context
  • Manually adding recap messages into the chat: inconsistent and noisy
  • Keeping this as a local/workspace-specific customization: useful for experimentation, but not a good upstream shape

Impact

Affected: TUI users returning to ongoing sessions, especially users who switch context often or resume work after a break Severity: Low to medium, but meaningful for workflow continuity Frequency: Common for ongoing/project-based TUI usage Consequence: extra manual scrolling, slower session re-entry, more friction in resuming interrupted work

Evidence/examples

OpenClaw already has broader work around memory, context continuity, summaries, and startup behavior, so this seems aligned with existing direction.

A local prototype of this behavior felt useful in practice, but it currently uses a workspace-specific source. For upstream, a generic and session-aware version would be the right shape.

Additional information

Preferred shape for upstream:

  • optional or safely gated
  • does not break normal history loading or session switching
  • generic/session-aware rather than tied to one workspace layout

extent analysis

TL;DR

Implement an optional startup summary block in the TUI to display a brief recap of the most recent session context.

Guidance

  • Identify the key information to be included in the summary block, such as recent conversation or session context, and determine how to source it from a generic session/context mechanism.
  • Design the summary block to be visually distinct from normal chat history and ensure it does not mix with transcript history in a confusing way.
  • Develop a mechanism to gate the summary block, making it optional and ensuring it does not break normal history loading or session switching.
  • Test the implementation with various session scenarios to ensure it provides a useful recap without introducing unnecessary friction.

Example

No specific code example can be provided without more context, but a possible approach could involve creating a separate UI component for the summary block and populating it with relevant data from the session/context mechanism.

Notes

The implementation should be mindful of the desired behavior, such as keeping the summary brief and avoiding manual scrolling and reconstruction of context. The generic/session-aware approach should be prioritized over hardcoded or workspace-specific solutions.

Recommendation

Apply a workaround by implementing the proposed solution, as it aligns with the existing direction of OpenClaw and addresses a meaningful workflow continuity issue for TUI users.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Feature]: TUI, show a short recent-session summary on startup/history load [1 pull requests, 1 participants]