feat(cli): add thread clear-name to remove a custom thread title (1600)#1939
feat(cli): add thread clear-name to remove a custom thread title (1600)#1939ousamabenyounes wants to merge 1 commit into
thread clear-name to remove a custom thread title (1600)#1939Conversation
…600) Issue 1600 asks for full rename UX: set a custom title, remove it back to `(unnamed)`. The set side already shipped as `deepseek thread set-name <id> <name>`, but there was no inverse — users who wanted to drop a no-longer-relevant title had to either edit the SQLite store by hand or set a placeholder string. Add `deepseek thread clear-name <id>`, mirroring the existing `SetName` arm in `run_thread_command`: look up the thread, set `name = None`, refresh `updated_at`, upsert. Printed confirmation is `cleared name for <id>` so it stays distinguishable from the `renamed` line emitted by `set-name`. Snapshot help test and the parser-matrix test both gain the new subcommand. No state-store changes: `upsert_thread` already accepts `name: None` and `thread list` already prints `(unnamed)` when the field is empty, so the round-trip is complete with this CLI-only change. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new clear-name subcommand to the thread management CLI, allowing users to remove a custom name from a thread. The changes include adding the ClearName variant to the ThreadCommand enum, implementing the logic to reset the thread name and update the timestamp in run_thread_command, and adding corresponding unit tests for command parsing. I have no feedback to provide as there were no review comments to evaluate.
|
Thanks for the focused CLI round-trip patch. This is useful and scoped, but I am not taking it into v0.8.42 stabilization because it has only GitGuardian on this PR and the release branch is already narrowed to the stream/RLM/handle_read/help fixes. Leaving it open for the next maintenance pass. The natural review path is current-branch CI plus a focused cargo test -p codewhale-cli thread --locked / parser-help check under the current crate names, then decide whether issue #1600 is fully covered or whether TUI picker/session display still needs a separate follow-up. |
Summary
Fix 1600
Issue 1600 asks for full rename UX on threads: set a custom title, and remove it back to
(unnamed). The set side already shipped asdeepseek thread set-name <id> <name>, but the inverse was missing — users who wanted to drop a no-longer-relevant title had to either edit the SQLite store by hand or write a placeholder string.This PR adds
deepseek thread clear-name <id>, mirroring the existingSetNamearm inrun_thread_command:get_thread), error out cleanly when the ID does not exist (thread not found: <id>).name = None, refreshupdated_at, upsert.cleared name for <id>so it stays distinguishable from therenamed <id>line emitted byset-name.No state-store changes are needed:
upsert_threadalready acceptsname: None, andthread listalready prints(unnamed)when the field is empty.The TUI session-picker key shortcut and
deepseek sessions(older alias) display, also mentioned in 1600, are intentionally not in scope for this PR — they touch separate surfaces (picker UI + thread/session display layers) and the harvest model in CONTRIBUTING.md prefers single-purpose contributions.Testing
cargo test -p deepseek-tui-cli— 65/65 pass, including a newparse_ok(&["deepseek", "thread", "clear-name", "thread-7"])assertion inparses_thread_command_matrixand a newclear-nameentry insubcommand_help_surfaces_are_stable.cargo fmt --all -- --check— cleancargo clippy -p deepseek-tui-cli --all-targets --all-features— no new warningsTDD verification (RED → GREEN)
RED — production change reverted (
ThreadCommand::ClearNamevariant + matchingrun_thread_commandarm + parser-matrixmatches!removed), only the snapshot list entry kept on the test side:GREEN — production change restored (HEAD of this branch):
The snapshot test pins clap's help surface (variant must be wired in for
clear-nameto appear); the parser-matrix test pins the dispatch shape. Therun_thread_commandarm itself mirrorsSetNameline-for-line except forname = None, so it is visually reviewable rather than RED/GREEN-tested.Checklist
(unnamed)round-trip)Files changed
crates/cli/src/lib.rsThreadCommand::ClearName { thread_id }variant, matchingrun_thread_commandarm, parser-matrix assertion, snapshot help update