Skip to content

fix: prepare v0.8.38 bug-bash fixes#1647

Merged
Hmbown merged 8 commits into
mainfrom
work/v0.8.38-bug-bash
May 14, 2026
Merged

fix: prepare v0.8.38 bug-bash fixes#1647
Hmbown merged 8 commits into
mainfrom
work/v0.8.38-bug-bash

Conversation

@Hmbown

@Hmbown Hmbown commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #1637.
Fixes #1592.
Fixes #1577.
Fixes #1593.
Fixes #1582.

Tests

  • cargo test -p deepseek-tui --bin deepseek-tui onboarding --locked
  • cargo test -p deepseek-tui --bin deepseek-tui reasoning_effort_uses_openai_compatible_shape_for_fireworks --locked
  • cargo test -p deepseek-tui --bin deepseek-tui chat_tool_wire_shape_omits_anthropic_only_metadata --locked
  • cargo test -p deepseek-tui --bin deepseek-tui reasoning_effort --locked
  • cargo test -p deepseek-tui --bin deepseek-tui osc_8 --locked
  • cargo test -p deepseek-tui --bin deepseek-tui paragraph_wrap --locked
  • node --test npm/deepseek-tui/test/install.test.js npm/deepseek-tui/test/postinstall.test.js npm/deepseek-tui/test/run.test.js
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • npm run lint (web)
  • npx tsc --noEmit (web)
  • git diff --check

Notes

Copilot AI review requested due to automatic review settings May 14, 2026 20:03

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.

Pull request overview

Bundles five v0.8.38 bug-bash fixes spanning the Rust TUI, npm wrapper, and marketing site: it tightens OpenAI-compatible chat payloads, prevents pnpm postinstall hangs, restores terminal modes on early TUI exits via an RAII guard, preserves full OSC 8 link targets across line wraps, and refreshes the website's update guidance.

Changes:

  • Strip Anthropic-only tool metadata (allowed_callers, defer_loading, input_examples) and stop sending top-level thinking to Fireworks; keep reasoning_effort for OpenAI-compat shape.
  • Skip optional install-time downloads when invoked under pnpm's optional postinstall, deferring binary fetch to first run; add a TerminalCleanupGuard so early TUI bail-outs restore raw mode/alt-screen/mouse/bracketed-paste/keyboard flags/cursor.
  • Refactor markdown wrap logic into InlineToken { text, style, link_url } so each wrapped chunk re-emits the full OSC 8 hyperlink target; update homepage/install page to surface deepseek update plus package-manager fallbacks.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/tui/src/client.rs Split Fireworks out of the Anthropic-style thinking branches in apply_reasoning_effort; add tests for OpenAI-compatible shape and stripped tool metadata.
crates/tui/src/client/chat.rs Drop allowed_callers/defer_loading/input_examples from the chat-completions tool wire shape (Anthropic-only fields).
crates/tui/src/tui/ui.rs Introduce TerminalCleanupGuard after terminal init and defuse it on the normal cleanup path so early returns still restore terminal modes.
crates/tui/src/tui/markdown_render.rs Replace (String, Style) tuples with InlineToken carrying the link URL so wrapped chunks re-wrap with the full OSC 8 target; add wrap regression test.
npm/deepseek-tui/scripts/install.js Add shouldSkipOptionalPostinstall to bypass install-time download under pnpm optional postinstall; first-run downloader still fetches the binary.
npm/deepseek-tui/test/postinstall.test.js Cover pnpm-vs-npm UA, runtime-vs-install context, and --optional flag combinations for the new gate.
CHANGELOG.md Document the four fixes plus the website update guidance and credit #1630's idea.
web/app/[locale]/page.tsx Replace npm/registry snippets with a concise install + deepseek update block on the homepage.
web/app/[locale]/install/page.tsx Insert a new "Update" section (deepseek update plus brew/npm/cargo equivalents) and renumber subsequent sections.
web/lib/facts.generated.ts Regenerated generatedAt timestamp.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces several improvements and fixes, including a refactored markdown renderer to ensure OSC 8 links maintain their full target across wrapped lines, a new TerminalCleanupGuard to reliably restore terminal modes on exit, and stricter request body formatting for OpenAI-compatible providers like Fireworks. It also optimizes pnpm installations by skipping binary downloads during postinstall and updates the website documentation to highlight the update command. Review feedback focused on improving the robustness of these changes, specifically suggesting that spaces within links should inherit the link URL to maintain clickability, and recommending that the terminal cleanup guard be initialized earlier and used more consistently to prevent resource leaks during initialization failures.

// The space consumed by split — attach as a plain space word
// so the wrap loop can decide whether to keep or break it.
words.push((" ".to_string(), style));
words.push(InlineToken::new(" ".to_string(), token.style, None));

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.

medium

Spaces within a link token should inherit the link_url from the parent token. Currently, they are initialized with None, which breaks the clickability of the space character in links containing multiple words (e.g., [click here](url)). This results in a fragmented link where only the individual words are clickable, but the spaces between them are not. By passing token.link_url.clone(), the entire link span remains clickable even when wrapped.

Suggested change
words.push(InlineToken::new(" ".to_string(), token.style, None));
words.push(InlineToken::new(" ".to_string(), token.style, token.link_url.clone()));

Comment thread crates/tui/src/tui/ui.rs
Comment on lines +314 to +319
let mut cleanup_guard = TerminalCleanupGuard {
use_alt_screen,
use_mouse_capture,
use_bracketed_paste,
defused: false,
};

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.

medium

The TerminalCleanupGuard should be initialized earlier in run_tui, ideally before any terminal state is modified (e.g., before enable_raw_mode() on line 246). In its current position, if an error occurs during terminal initialization (like EnterAlternateScreen failing on line 268), the guard is never created, and the terminal is left in raw mode. Moving the guard to the start of the function ensures that cleanup happens reliably for all early exit paths.

Comment thread crates/tui/src/tui/ui.rs
persistence_actor::persist(PersistRequest::ClearCheckpoint);
persistence_actor::persist(PersistRequest::Shutdown);

cleanup_guard.defused = true;

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.

medium

Defusing the cleanup_guard here makes the subsequent manual cleanup block (lines 533-545) redundant and potentially unsafe. If any of those manual steps (like disable_raw_mode()?) fail, the remaining cleanup operations (leaving the alternate screen, disabling mouse capture, etc.) will be skipped because the guard is already defused. It is safer to remove the manual cleanup block entirely and let the guard handle it automatically when it goes out of scope, or at least move the defusal to the very end of the function after all cleanup steps have succeeded.

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

Labels

None yet

Projects

None yet

2 participants