This repository was archived by the owner on Apr 27, 2026. It is now read-only.
Repository navigation
fix: reset token state on /new and support DeepSeek reasoning_effort - #524
Merged
Merged
Conversation
Bug fix:
- /new command now clears DB token state (SetTokenState(0,0)) so the
context usage bar resets instead of showing stale values from the
previous session
- Agent sends session_reset metadata in the /new response
- CLI clears lastTokenUsage and context bar cache when it detects
session_reset metadata (works in both local and remote modes)
- Remote mode: wsMessage and wsIncomingMessage carry session_reset
field through WebSocket
Feature:
- OpenAI-compatible LLM provider now supports DeepSeek reasoning_effort
parameter via thinking_mode JSON config:
{"thinking":{"type":"enabled"},"reasoning_effort":"high"}
- buildThinkingOptions handles three JSON formats:
1. Flat thinking object: {"type":"enabled"}
2. Nested with extras: {"thinking":{...},"reasoning_effort":"high"}
3. Arbitrary key-values: {"reasoning_effort":"high"}
- Updated /set-llm usage documentation with DeepSeek reasoning_effort
example
Refs: https://api-docs.deepseek.com/zh-cn/guides/thinking_mode
Update all URLs referencing the old repository to the new home at github.com/ai-pivot/xbot: - Install scripts (install.sh, install.ps1): REPO variable - Update check (version/check.go): primary URL → ai-pivot/xbot, with fallback to CjiW/xbot during transition period - i18n update messages: curl install URLs - CLI help text: install hint URL - fetch.go: User-Agent header URL - README.md: install commands and git clone URL - docs-site: installation page, index, hugo.toml repo link The version checker tries the new repo first. If no releases exist yet on ai-pivot/xbot, it falls back to CjiW/xbot so existing users continue to receive update notifications during the migration.
Install scripts now try ai-pivot/xbot first, and fall back to CjiW/xbot if the release is not found (404). This keeps CI passing while the new repo has no releases yet. Applies to: - install.sh: resolve_version, binary download, web dist, checksums - install.ps1: Get-LatestVersion, binary download, checksums
Chronostasys
force-pushed
the
fix/new-token-reset-and-deepseek-effort
branch
from
April 26, 2026 12:45
6ad385d to
add61ac
Compare
…ting Add 'DeepSeek: effort=high' and 'DeepSeek: effort=max' options to the Thinking Mode selector in TUI Settings panel (all 3 locales: zh/en/ja). These encode reasoning_effort into the thinking_mode JSON value so no DB schema change is needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug Fix:
/new后上下文进度条没重置根因:
handleNewSession清空了消息和记忆,但没有清理 DB 中的 token state (SetTokenState(0,0)),也没有通知 CLI 端清除lastTokenUsage。下次Run()恢复了旧 token 数据,进度条显示上一轮的值。修复:
handleNewSession中调用SetTokenState(0,0)清 DB token state/new回复通过Metadata["session_reset"]通知客户端handleAgentMessage检测session_reset后清除lastTokenUsage和 context bar 缓存wsMessage/wsIncomingMessage新增SessionReset字段通过 WS 传递Feature: DeepSeek reasoning_effort 参数支持
根据 DeepSeek 思考模式文档,工具调用场景支持
reasoning_effort参数控制思考强度。实现:
buildThinkingOptions支持三种 JSON 格式:{"type":"enabled"}{"thinking":{"type":"enabled"},"reasoning_effort":"high"}{"reasoning_effort":"high"}reasoning_content回传逻辑已正确处理(无需改动)/set-llmusage 文档示例:
测试
go build ./...go test ./...(all packages pass)