Skip to content

/new should re-display startup context (loaded resources, git state refresh) #318

Description

@m-aebrer

Summary

When a user runs /new to start a fresh session, the TUI only shows ✓ New session started. It does not re-display the loaded resources listing ([Context], [Memory], [Skills], [Prompts], [Extensions], [Themes]) that appears at initial startup, nor does it refresh the git repo state that's baked into the system prompt. This makes /new feel disconnected — users lose visibility into what context the new session has access to.

Current Behavior

  • /new calls handleClearCommand() which resets the session, clears all UI containers, and renders only ✓ New session started
  • The header (logo, keybinding hints, changelog) is cleared and not rebuilt
  • showLoadedResources() is not called — no [Context]/[Memory]/[Skills]/etc. listing
  • _gitRepoState (captured once in the AgentSession constructor) is not refreshed — the new session's system prompt contains stale branch/commit/PR info from when the process originally started

Proposed Behavior

  • After /new, re-display the loaded resources listing (respecting quietStartup setting — show diagnostics even when quiet, full listing otherwise)
  • Refresh _gitRepoState so the new session's system prompt reflects the current branch, recent commits, and open PRs (the user may have switched branches or made commits since the process started)
  • Optionally re-display a minimal header (logo + version) to give visual grounding, but skip changelog/"What's New" (already seen)

Acceptance Criteria

  • After /new, the chat area shows loaded resources ([Context], [Memory], [Skills], etc.) same as initial startup (controlled by quietStartup setting)
  • After /new, _gitRepoState is refreshed from the current working directory so the system prompt for the new session is accurate
  • The changelog/"What's New" section is NOT re-shown (it's a per-version notification, not per-session)
  • The keybinding hints header is NOT re-shown (user already knows them)
  • quietStartup setting is respected: if enabled, only diagnostics/conflicts are shown (same gating as initial startup)
  • Extension session_switch event still fires as before (no regression)

Technical Notes

  • handleClearCommand() at interactive-mode.ts:4958 — needs to call showLoadedResources() after clearing
  • AgentSession.newSession() at agent-session.ts:1901 — needs to call getGitRepoState() to refresh _gitRepoState (note: switchSession/resume already refreshes it, so there's precedent)
  • showLoadedResources() at interactive-mode.ts:1148 already respects quietStartup and has a force option — can be called directly
  • Consider whether resources should be reloaded (resourceLoader.reload()) or just re-displayed. If the user added a new AGENTS.md or skill file since startup, reloading would be more useful. However, that's a larger scope change — re-displaying the current state is the minimum fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions