Skip to content

[Feature] Add session renaming functionality and improve session metadata - #814

Open
arpan7sarkar wants to merge 5 commits into
Nano-Collective:mainfrom
arpan7sarkar:feat/rename-sessions
Open

[Feature] Add session renaming functionality and improve session metadata#814
arpan7sarkar wants to merge 5 commits into
Nano-Collective:mainfrom
arpan7sarkar:feat/rename-sessions

Conversation

@arpan7sarkar

Copy link
Copy Markdown
Contributor

Description

Fixes #749

rename-chat.mp4

Improve session management & history UX in the VS Code extension.

  • Session renaming: Sessions can now be renamed directly from the History view via a renameSession ACP extension method (extMethod) on the CLI's ACP agent, backed by the session manager — no full resume required.
  • History view navigation: Creating a new chat (+) or resuming a session from the History list now returns to the active chat view instead of leaving the panel stuck on the session list.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changeset

  • Added a changeset (pnpm changeset) describing this change for the changelog

Docs-only or internal chores need no changeset (or run pnpm changeset --empty to note that intentionally).

Testing

Automated Tests

  • New features include passing tests in .spec.ts/tsx files
  • All existing tests pass (pnpm test:all completes successfully)
  • Tests cover both success and error scenarios

Manual Testing

  • Tested with Ollama
  • Tested with OpenRouter
  • Tested with OpenAI-compatible API
  • Tested MCP integration (if applicable)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)
  • Appropriate logging added using structured logging

- Implemented a new method to rename sessions in the ACP client and updated the corresponding webview provider to handle rename requests.
- Enhanced session data structure to include an `updatedAt` timestamp for better session management.
- Modified the chat panel to display relative time for the last session update.
- Updated session management logic to prevent auto-derived titles from overwriting user-defined titles.
- Added UI elements for editing session titles in the chat panel, including input handling for renaming sessions.
Copilot AI lite review requested due to automatic review settings August 7, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@arpan7sarkar

Copy link
Copy Markdown
Contributor Author

Hey @Avtrkrb , @akramcodez , @will-lamerton do check this out its all done :-)

@will-lamerton

Copy link
Copy Markdown
Member

Hey @arpan7sarkar - thanks for this, the extMethod approach is the right call and the titleManuallySet threading is clean. A few things before merge:

Blocking: case 'renameSession' in chat-webview-provider.ts is missing its break;, so it falls through into requestPathInfo. That's not just cosmetic - npx tsc --noEmit -p plugins/vscode/tsconfig.json fails with three new TS2339: Property 'path' does not exist errors that aren't on main, and at runtime every rename hits fs.statSync(undefined) and gets swallowed by the bare catch {}. (Worth knowing: test:all doesn't cover the plugin and build:ext is esbuild with no type checking, so CI can't catch this today.)

Please also fix: updatedAt maps to lastAccessedAt, which is only ever written by createSession and loadSession. Autosave never bumps it, so the new "Today / Yesterday / Last 7 Days" buckets and the "5m ago" label show created-or-resumed time, not last activity. A session created three days ago and chatted in a minute ago renders as "3d ago". Either bump lastAccessedAt on autosave or add a real updatedAt field.

Two smaller ones:

  • The checklist says tests were added but the diff has none. session-manager.spec.ts and acp-agent.spec.ts already exist, and renameSession (empty title, over-length, missing session, flag round-trip) plus extMethod (unknown method, non-string params) would be easy to cover there.
  • The comment at useSessionAutosave.ts:153 says /rename in the CLI sets this flag. It doesn't - onRenameSession is wired to setSessionName, which is display-only state for the status line and never reaches disk. Either wire it through sessionManager.renameSession or reword the comment.

Nice-to-haves, not blockers: input.maxLength = 100 so an over-length title fails locally instead of round-tripping to an error toast, and sorting within date groups by updatedAt rather than reversed creation order.

Thanks :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Chat Session Management Polish in VS Code Extension

3 participants