Skip to content

fix(chat): add --session-id flag and fix exit message - #760

Merged
edenreich merged 3 commits into
mainfrom
fix/chat-session-id-flag
Jul 6, 2026
Merged

edenreich merged 3 commits into
mainfrom
fix/chat-session-id-flag

Conversation

@edenreich

Copy link
Copy Markdown
Contributor

Description

Commit 8d04a3a added a session continuation message on chat exit, but the message incorrectly pointed users to infer agent --session-id (headless agent mode) instead of infer chat --session-id (interactive chat TUI). The chat command also lacked a --session-id flag entirely.

This PR adds the --session-id flag to the chat command and fixes the exit message.

Changes

  1. internal/domain/interfaces.go — Added LoadConversation(ctx, conversationID) to the ConversationLifecycleManager interface
  2. internal/services/conversation.go — Added no-op LoadConversation on InMemoryConversationRepository (safe since PersistentConversationRepository already overrides it)
  3. cmd/chat.go — Added --session-id flag, wired it through StartChatSession, and fixed the exit message from infer agent --session-id to infer chat --session-id
  4. cmd/chat_test.go — Updated test expectations to match the corrected message
  5. internal/app/chat.go — Added UpdateHistoryEvent emission in Init() to display loaded messages immediately
  6. tests/mocks/domain/fake_conversation_repository.go — Regenerated counterfeiter fakes for the updated interface

Testing

  • Existing tests pass (go test ./cmd/ -run TestChat)
  • Build succeeds (go build ./cmd/chat.go)
  • go vet ./... reports no interface errors

- Add LoadConversation method to ConversationLifecycleManager interface
- Implement no-op LoadConversation on InMemoryConversationRepository
- Add --session-id flag to chat command, wired through StartChatSession
- Fix exit message to show 'infer chat --session-id' instead of 'infer agent --session-id'
- Update tests to match the corrected exit message
- Generate/update counterfeiter fake for ConversationRepository

Fixes the bug where the chat exit message pointed users to
'infer agent --session-id' which runs headless agent mode, not
the interactive chat TUI they were using.
@edenreich
edenreich requested a review from a team as a code owner July 6, 2026 11:50
…with agent

- Print a visible notice when --session-id cannot be loaded, adopting the
  requested ID for the new session (mirrors infer agent behaviour)
- Warn when --session-id is passed in web or non-interactive mode instead
  of silently ignoring it
- Make InMemoryConversationRepository.LoadConversation return an explicit
  error instead of claiming success
- Extract chatExitMessage and test it plus flag registration and the
  resume path with counterfeiter fakes
- Document infer chat --session-id in the README
@edenreich
edenreich force-pushed the fix/chat-session-id-flag branch from 3d50e14 to 7768c3c Compare July 6, 2026 12:09
@edenreich
edenreich merged commit a2202ba into main Jul 6, 2026
1 check passed
@edenreich
edenreich deleted the fix/chat-session-id-flag branch July 6, 2026 12:22
inference-gateway-releaser Bot added a commit that referenced this pull request Jul 6, 2026
## [0.133.0](v0.132.1...v0.133.0) (2026-07-06)

### 🚀 Features

* add nvidia provider support ([#753](#753)) ([e9ea883](e9ea883)), closes [#751](#751)
* **agent:** cap rendered skills list and harden system prompt injection ([#761](#761)) ([cb0f36e](cb0f36e))
* scope memory entries by project ([#759](#759)) ([cabda08](cabda08)), references [#758](#758)
* **chat:** show session continuation instructions on exit ([#757](#757)) ([8d04a3a](8d04a3a)), closes [#756](#756)

### 🐛 Bug Fixes

* **chat:** add --session-id flag and fix exit message ([#760](#760)) ([a2202ba](a2202ba))
* **ci:** release notes are not being generated ([32b7acf](32b7acf))
* replace /compact with /new when plan is accepted ([#755](#755)) ([30304ed](30304ed)), closes [#754](#754)

### ♻️ Code Refactoring

* **agent:** remove comments about skill description capping ([e50aa30](e50aa30))

### 🧹 Maintenance

* **deps:** bump claude-code-action v1.0.161 -> v1.0.165 ([#752](#752)) ([44d1985](44d1985))
* **deps:** update flox packages ([8a35d5e](8a35d5e))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.133.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant