Polish user memory help and documentation#569
Conversation
- add /memory help and clearer invalid-subcommand guidance - register /memory in shared slash-command help - align memory docs with current behavior and config - add focused tests for help and discovery
There was a problem hiding this comment.
Code Review
This pull request polishes the user memory feature by adding a dedicated /memory help subcommand and integrating the /memory command into the global help system. The changes include updated documentation in README.md, docs/CONFIGURATION.md, and docs/MEMORY.md to cover new configuration options like [memory].enabled and the DEEPSEEK_MEMORY environment variable. Additionally, the PR introduces localized command descriptions for multiple languages and adds comprehensive unit tests to verify the help output and command behavior. I have no feedback to provide as there were no review comments to assess.
|
thank you! let me check on what i'm adding to 0.8.10 as there's a large update to memory planned soon and it should ship tomorrow AM but this will absolutely be key in making sure this works! |
|
Thank you very much for the quick merge, and for the context about the larger memory update planned for 0.8.10. I’m glad this can help, and I’d be happy to follow up with any adjustments if the upcoming memory changes expose anything else worth tightening. |
- add /memory help and clearer invalid-subcommand guidance - register /memory in shared slash-command help - align memory docs with current behavior and config - add focused tests for help and discovery
* fix(sandbox): allow ~/.cargo/registry under macOS seatbelt (#558) Sandboxed shell sessions on macOS were rejecting reads/writes to ~/.cargo/registry/{cache,index,src} and ~/.cargo/git, making `cargo build`/`cargo publish` unrunnable from inside the TUI's shell tool (hit while shipping v0.8.9). * Resolve cargo home via `CARGO_HOME` env (cargo's own override) with a `$HOME/.cargo` fallback. New helper `resolve_cargo_home()` is shared by the policy generator and the param table to keep them in lockstep — emit one without the other and `sandbox-exec` refuses to load the profile. * Always allow read access on `(param "CARGO_HOME")`. Grant write access to the `registry/` and `git/` subpaths whenever the policy isn't read-only — those directories must be mutable for `cargo` to populate them on a cache miss. * Skip the cargo block entirely when neither `CARGO_HOME` nor `HOME` is set so we never reference an undefined `(param ...)`. (Practically only fires in stripped CI containers.) Two tests cover the policy/param sync — one with HOME set, one with both vars cleared — using a module-local `ENV_LOCK` mutex to serialize env mutation, mirroring the pattern landed in `main.rs` at d06eaed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(mcp): graceful SIGTERM shutdown for stdio servers (#420) Stdio MCP child processes were getting SIGKILL'd via tokio's `kill_on_drop(true)` on TUI exit. The contract calls for SIGTERM so well-behaved servers can flush pending state before dying. Changes: * New `async fn shutdown(&mut self)` on `McpTransport` (default no-op). `StdioTransport` overrides it to send SIGTERM via `libc::kill` and await child exit up to a 2-second grace window before letting drop fire SIGKILL as the backstop. Graceful path on Unix; on Windows the `kill_on_drop` (TerminateProcess) path remains unchanged because there's no SIGTERM-equivalent. * New `Drop` on `StdioTransport` sends SIGTERM as a fallback for code paths that didn't call `shutdown` explicitly. Drop is sync, so the signal arrives microseconds before tokio's own Child drop fires SIGKILL, but it still gives MCP servers that handle SIGTERM idempotently a chance to start cleanup. * New `McpPool::shutdown_all` walks every connection, calls the async shutdown, and clears the pool. * The agent engine's run loop calls `shutdown_all` on `Op::Shutdown` before the pool drops so graceful exit is the default path. Best-effort — if the pool isn't initialized or the lock is contended, the Drop fallback still sends SIGTERM. Test: `stdio_transport_shutdown_terminates_child` spawns a real `cat` child, calls `shutdown`, asserts the call returns within the grace window, and confirms the pid is reaped (`kill(pid, 0)` returns ESRCH). Unix-only — Windows already exercised by the kill_on_drop path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(shell): set PR_SET_PDEATHSIG on Linux to reap orphaned children (#421) Shell-spawned children survive the TUI on abnormal exit (panic without unwind, SIGKILL of the parent, OOM). The existing cooperative cancel path SIGKILLs the whole process group via the cancellation token, but that only fires when the parent gets to run its drop / cleanup code. A crashed parent leaves children orphaned to init. * New `install_parent_death_signal` helper called on every shell Command setup. On Linux it adds a `pre_exec` hook that runs `prctl(PR_SET_PDEATHSIG, SIGTERM)` immediately after fork — the kernel then sends SIGTERM to the child the moment our process exits, even on SIGKILL of the TUI itself. * All three Command spawn sites in `tools/shell.rs` (one-shot, wait, interactive) get the same hook. * Documented the macOS / Windows gap: those platforms have no kernel equivalent. The cooperative path still handles normal shutdown; abnormal exit there is tracked as a watchdog follow-up per the issue's acceptance criteria. The pre_exec body is `unsafe`-marked because it runs in the post-fork async-signal-safe window. The closure only calls `libc::prctl` with stack-allocated constants; no heap, no locks. Errno is surfaced via `std::io::Error::last_os_error` but the spawn is not aborted — losing the safety net is strictly less bad than failing the user's command. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(subagent): interleave Chinese whale names with English in nickname pool Sub-agent UI labels rotate through `WHALE_NICKNAMES`. The list was English-only — every spawn produced "Blue", "Humpback", etc. Adding Simplified-Chinese names (蓝鲸, 座头鲸, 抹香鲸, …) interleaved with the English ones doubles the pool size and gives a roughly even mix on each new spawn, with the same wraparound behavior at index >= 48. Goal is friendly variety, not strict locale matching — a CN-locale user still gets some English names and vice versa. Pure cosmetic; no behavioral or persistence-format change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * style: cargo fmt for seatbelt cargo home block * memory: polish help and docs (#569) - add /memory help and clearer invalid-subcommand guidance - register /memory in shared slash-command help - align memory docs with current behavior and config - add focused tests for help and discovery * feat(onboarding): language picker step before API key (#566) First-run users hit Welcome → API key → Trust → Tips with no obvious way to discover that a Chinese / Japanese / Portuguese UI exists. Issue #566 surfaced this from a Chinese user. The TUI already has full translations for `en`, `ja`, `zh-Hans`, `pt-BR` (plus `auto` detection from `LC_ALL` / `LANG`); the only gap was discoverability. * New `OnboardingState::Language` variant inserted between Welcome and ApiKey. `Welcome → Language → ApiKey/Trust/Tips` is the new flow; `Esc` from Language returns to Welcome. * New `tui/onboarding/language.rs` panel renders the picker with hotkeys 1-5 for `auto` / `en` / `ja` / `zh-Hans` / `pt-BR`. Each row shows the native name (日本語, 简体中文, …) plus an English label so the user doesn't have to read the target language to pick it. The currently persisted setting is highlighted with a filled bullet. * Selecting a hotkey calls the new `App::set_locale_from_onboarding` which writes through `Settings::set("locale", …)` + `Settings::save` and re-resolves `app.ui_locale` immediately so the rest of onboarding renders in the chosen language. Pressing Enter keeps the current setting (defaults to `auto`). * `onboarding_step` now reports `1/N` … `N/N` correctly with the new step inserted (Welcome=1, Language=2, ApiKey=3 if needed, …). * Doesn't expand the supported-locale set — the QA-pending list in `localization::PLANNED_QA_LOCALES` is unchanged. We only show what ships with full coverage today. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: 20bytes <133551439+20bytes@users.noreply.github.com>
Picks up the v0.8.10 patch release contents: * Daemon API quartet for whalescale-desktop integration (#561-#564, PR #567). * Bug cluster: macOS seatbelt cargo registry (#558), MCP SIGTERM shutdown (#420), Linux PR_SET_PDEATHSIG (#421). * npm install on older glibc fix (#555/#560 via #556 + #565). * Shell cwd workspace-boundary validation (#524). * Memory help/docs polish (#497 via #569). * Onboarding language picker (#566). * Whale nicknames interleaved with Simplified Chinese. First-time contributors credited in CHANGELOG: @staryxchen, @shentoumengxin, @Vishnu1837, @20bytes. Workspace `Cargo.toml`, all 9 internal path-dep version pins, and `npm/deepseek-tui/package.json` all bumped to 0.8.10. `Cargo.lock` regenerated and committed alongside. Verified locally: * cargo fmt --all -- --check * cargo clippy --workspace --all-targets --all-features --locked -- -D warnings * cargo test --workspace --all-features --locked * bash scripts/release/check-versions.sh Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- add /memory help and clearer invalid-subcommand guidance - register /memory in shared slash-command help - align memory docs with current behavior and config - add focused tests for help and discovery
) * fix(sandbox): allow ~/.cargo/registry under macOS seatbelt (Hmbown#558) Sandboxed shell sessions on macOS were rejecting reads/writes to ~/.cargo/registry/{cache,index,src} and ~/.cargo/git, making `cargo build`/`cargo publish` unrunnable from inside the TUI's shell tool (hit while shipping v0.8.9). * Resolve cargo home via `CARGO_HOME` env (cargo's own override) with a `$HOME/.cargo` fallback. New helper `resolve_cargo_home()` is shared by the policy generator and the param table to keep them in lockstep — emit one without the other and `sandbox-exec` refuses to load the profile. * Always allow read access on `(param "CARGO_HOME")`. Grant write access to the `registry/` and `git/` subpaths whenever the policy isn't read-only — those directories must be mutable for `cargo` to populate them on a cache miss. * Skip the cargo block entirely when neither `CARGO_HOME` nor `HOME` is set so we never reference an undefined `(param ...)`. (Practically only fires in stripped CI containers.) Two tests cover the policy/param sync — one with HOME set, one with both vars cleared — using a module-local `ENV_LOCK` mutex to serialize env mutation, mirroring the pattern landed in `main.rs` at d06eaed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(mcp): graceful SIGTERM shutdown for stdio servers (Hmbown#420) Stdio MCP child processes were getting SIGKILL'd via tokio's `kill_on_drop(true)` on TUI exit. The contract calls for SIGTERM so well-behaved servers can flush pending state before dying. Changes: * New `async fn shutdown(&mut self)` on `McpTransport` (default no-op). `StdioTransport` overrides it to send SIGTERM via `libc::kill` and await child exit up to a 2-second grace window before letting drop fire SIGKILL as the backstop. Graceful path on Unix; on Windows the `kill_on_drop` (TerminateProcess) path remains unchanged because there's no SIGTERM-equivalent. * New `Drop` on `StdioTransport` sends SIGTERM as a fallback for code paths that didn't call `shutdown` explicitly. Drop is sync, so the signal arrives microseconds before tokio's own Child drop fires SIGKILL, but it still gives MCP servers that handle SIGTERM idempotently a chance to start cleanup. * New `McpPool::shutdown_all` walks every connection, calls the async shutdown, and clears the pool. * The agent engine's run loop calls `shutdown_all` on `Op::Shutdown` before the pool drops so graceful exit is the default path. Best-effort — if the pool isn't initialized or the lock is contended, the Drop fallback still sends SIGTERM. Test: `stdio_transport_shutdown_terminates_child` spawns a real `cat` child, calls `shutdown`, asserts the call returns within the grace window, and confirms the pid is reaped (`kill(pid, 0)` returns ESRCH). Unix-only — Windows already exercised by the kill_on_drop path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(shell): set PR_SET_PDEATHSIG on Linux to reap orphaned children (Hmbown#421) Shell-spawned children survive the TUI on abnormal exit (panic without unwind, SIGKILL of the parent, OOM). The existing cooperative cancel path SIGKILLs the whole process group via the cancellation token, but that only fires when the parent gets to run its drop / cleanup code. A crashed parent leaves children orphaned to init. * New `install_parent_death_signal` helper called on every shell Command setup. On Linux it adds a `pre_exec` hook that runs `prctl(PR_SET_PDEATHSIG, SIGTERM)` immediately after fork — the kernel then sends SIGTERM to the child the moment our process exits, even on SIGKILL of the TUI itself. * All three Command spawn sites in `tools/shell.rs` (one-shot, wait, interactive) get the same hook. * Documented the macOS / Windows gap: those platforms have no kernel equivalent. The cooperative path still handles normal shutdown; abnormal exit there is tracked as a watchdog follow-up per the issue's acceptance criteria. The pre_exec body is `unsafe`-marked because it runs in the post-fork async-signal-safe window. The closure only calls `libc::prctl` with stack-allocated constants; no heap, no locks. Errno is surfaced via `std::io::Error::last_os_error` but the spawn is not aborted — losing the safety net is strictly less bad than failing the user's command. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(subagent): interleave Chinese whale names with English in nickname pool Sub-agent UI labels rotate through `WHALE_NICKNAMES`. The list was English-only — every spawn produced "Blue", "Humpback", etc. Adding Simplified-Chinese names (蓝鲸, 座头鲸, 抹香鲸, …) interleaved with the English ones doubles the pool size and gives a roughly even mix on each new spawn, with the same wraparound behavior at index >= 48. Goal is friendly variety, not strict locale matching — a CN-locale user still gets some English names and vice versa. Pure cosmetic; no behavioral or persistence-format change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * style: cargo fmt for seatbelt cargo home block * memory: polish help and docs (Hmbown#569) - add /memory help and clearer invalid-subcommand guidance - register /memory in shared slash-command help - align memory docs with current behavior and config - add focused tests for help and discovery * feat(onboarding): language picker step before API key (Hmbown#566) First-run users hit Welcome → API key → Trust → Tips with no obvious way to discover that a Chinese / Japanese / Portuguese UI exists. Issue Hmbown#566 surfaced this from a Chinese user. The TUI already has full translations for `en`, `ja`, `zh-Hans`, `pt-BR` (plus `auto` detection from `LC_ALL` / `LANG`); the only gap was discoverability. * New `OnboardingState::Language` variant inserted between Welcome and ApiKey. `Welcome → Language → ApiKey/Trust/Tips` is the new flow; `Esc` from Language returns to Welcome. * New `tui/onboarding/language.rs` panel renders the picker with hotkeys 1-5 for `auto` / `en` / `ja` / `zh-Hans` / `pt-BR`. Each row shows the native name (日本語, 简体中文, …) plus an English label so the user doesn't have to read the target language to pick it. The currently persisted setting is highlighted with a filled bullet. * Selecting a hotkey calls the new `App::set_locale_from_onboarding` which writes through `Settings::set("locale", …)` + `Settings::save` and re-resolves `app.ui_locale` immediately so the rest of onboarding renders in the chosen language. Pressing Enter keeps the current setting (defaults to `auto`). * `onboarding_step` now reports `1/N` … `N/N` correctly with the new step inserted (Welcome=1, Language=2, ApiKey=3 if needed, …). * Doesn't expand the supported-locale set — the QA-pending list in `localization::PLANNED_QA_LOCALES` is unchanged. We only show what ships with full coverage today. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: 20bytes <133551439+20bytes@users.noreply.github.com>
Picks up the v0.8.10 patch release contents: * Daemon API quartet for whalescale-desktop integration (Hmbown#561-Hmbown#564, PR Hmbown#567). * Bug cluster: macOS seatbelt cargo registry (Hmbown#558), MCP SIGTERM shutdown (Hmbown#420), Linux PR_SET_PDEATHSIG (Hmbown#421). * npm install on older glibc fix (Hmbown#555/Hmbown#560 via Hmbown#556 + Hmbown#565). * Shell cwd workspace-boundary validation (Hmbown#524). * Memory help/docs polish (Hmbown#497 via Hmbown#569). * Onboarding language picker (Hmbown#566). * Whale nicknames interleaved with Simplified Chinese. First-time contributors credited in CHANGELOG: @staryxchen, @shentoumengxin, @Vishnu1837, @20bytes. Workspace `Cargo.toml`, all 9 internal path-dep version pins, and `npm/deepseek-tui/package.json` all bumped to 0.8.10. `Cargo.lock` regenerated and committed alongside. Verified locally: * cargo fmt --all -- --check * cargo clippy --workspace --all-targets --all-features --locked -- -D warnings * cargo test --workspace --all-features --locked * bash scripts/release/check-versions.sh Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
This PR polishes the user-memory help and documentation surface and aligns it with the current implementation.
Changes in this PR:
/memory help, including the resolved path and subcommand guidance/memoryin the shared slash-command help surface so/help memoryworksDEEPSEEK_MEMORY,[memory].enabled,DEEPSEEK_MEMORY_PATH, and memory scope more clearly/memory help, disabled-state guidance, and help-topic discoveryCloses #497.
Source of Truth
I used the current implementation as the source of truth, primarily:
crates/tui/src/commands/memory.rscrates/tui/src/tools/remember.rscrates/tui/src/config.rscrates/tui/src/memory.rsTesting
I verified this locally with:
cargo fmt --all --checkcargo test -p deepseek-tui memory/memory helpand/help memoryin the TUIThank you for taking a look.