feat(cli): add /thinkback command to review session timeline of decisions, changes and fixes#2917
feat(cli): add /thinkback command to review session timeline of decisions, changes and fixes#2917wenshao wants to merge 14 commits intoQwenLM:mainfrom
Conversation
- Added a new `/thinkback` slash command to review the current session's key decisions and changes. - Added support for `--from` and `--topic` filters to narrow down the timeline context. - Registered the command in `BuiltinCommandLoader.ts`. - Included a comprehensive test suite covering empty histories, missing configs, concurrent triggers, and argument passing.
📋 Review SummaryThis PR introduces a new 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
… from LLM prompts - Fix TS compile error: HistoryItemWithoutId import path in test - Add i18n keys for all 6 locales (en/zh/ja/ru/pt/de) - Remove t() wrapping from LLM prompt strings to avoid degrading model output quality Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new built-in CLI slash command (/thinkback) that generates a timeline-style review of the current session, with optional --from and --topic filters, plus registration and localization updates.
Changes:
- Introduces
thinkbackCommandto generate a timeline review from chat history via the Gemini client. - Registers
/thinkbackinBuiltinCommandLoader. - Adds tests and new i18n strings for multiple locales.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli/src/ui/commands/thinkbackCommand.ts | Implements /thinkback command logic, argument parsing, and ACP streaming support. |
| packages/cli/src/ui/commands/thinkbackCommand.test.ts | Adds unit tests for empty history, argument passing, missing config, and interactive concurrency blocking. |
| packages/cli/src/services/BuiltinCommandLoader.ts | Registers the new built-in command so it’s available in the CLI. |
| packages/cli/src/i18n/locales/en.js | Adds English strings for the new command. |
| packages/cli/src/i18n/locales/zh.js | Adds Chinese translations for the new command strings. |
| packages/cli/src/i18n/locales/ja.js | Adds Japanese translations for the new command strings. |
| packages/cli/src/i18n/locales/ru.js | Adds Russian locale keys (currently untranslated English values). |
| packages/cli/src/i18n/locales/pt.js | Adds Portuguese locale keys (currently untranslated English values). |
| packages/cli/src/i18n/locales/de.js | Adds German locale keys (currently untranslated English values). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add proper ru/pt/de translations for thinkback i18n keys - Add vi.clearAllMocks() in beforeEach to prevent mock state leakage between tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Switch to getHistory(true) to exclude invalid/empty model contents - Rename fromTopic -> fromTimeRange, topicMatch -> topicFilter for clarity Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add session timeline review section (1.6) with usage examples, execution modes, and tips. Update section numbering (1.7-1.9). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Verify stream_messages async generator yields progress and timeline messages in ACP execution mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add formatThinkbackError() helper with translated error template
"Failed to generate thinkback timeline: {{error}}" consistent with
summaryCommand's formatErrorMessage pattern. Applied across all
error paths (interactive, non-interactive, ACP).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ck paths
Returning {type:'message', content:''} still creates an empty history
entry. Return void so slashCommandProcessor skips result processing
entirely when ui.addItem already handled the display.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The inner "Failed to generate thinkback - ..." message was wrapped by formatThinkbackError, producing redundant output. Shortened to "No text content received from LLM response" so the outer wrapper provides full context. Also fix "Tokens" -> "tokens" in docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…back Move setPendingItem(null) to a finally block so the pending indicator is always cleared regardless of how the operation ends (success, error, or external abort). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Verify that non-interactive mode returns {type:'message', messageType:'error'}
with formatted error content, unlike interactive mode which returns void.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Closing: Claude Code's /think-back is a Year in Review animation feature, not a session timeline review command. This PR was based on an incorrect analysis of Claude Code's thinkback functionality. |
Summary
Add a new
/thinkbackslash command that leverages the LLM to analyze conversation history and generate a structured timeline of key events in the current session.Comparison with Claude Code
Claude Code currently does not have a built-in session timeline review command. Users must manually scroll through conversation or rely on
/compact(context compression) which discards detail rather than summarizing it./thinkback)--from "1h ago"--topic "auth"This is a new capability beyond Claude Code's feature set, giving Qwen Code users a structured way to review session progress without losing context.
Before / After
Before
Users have no structured way to review what happened during a session. To recall key decisions, file changes, or bug fixes, they must manually scroll through the entire conversation history.
After
Users can run
/thinkbackto get an auto-generated timeline:With optional filtering:
Changes
thinkbackCommand.tsthinkbackCommand.test.tsBuiltinCommandLoader.tsen.js,zh.js,ja.js,ru.js,pt.js,de.jsReview notes (fixes applied during audit)
Original implementation was by gemini-3.1-pro-preview. The following issues were found and fixed:
import('./types.js').HistoryItemWithoutIdreferenced wrong module, fixed toimport('../types.js')t()— Translating prompts sent to the LLM degrades output quality. Removedt()wrapping, now uses plain strings (consistent withbtwCommandpattern)Test plan
npx tsc --noEmit— no type errorsvitest run thinkbackCommand.test.ts— 5/5 passedvitest run BuiltinCommandLoader.test.ts— 9/9 passed