Skip to content

sync: taiji 定制版同步最新基线 8d810b99e(LegionCard 样式统一 + 群聊 P0 修复) - #2262

Open
1688mengdie wants to merge 451 commits into
GCWing:mainfrom
1688mengdie:custom/taiji-unofficial
Open

sync: taiji 定制版同步最新基线 8d810b99e(LegionCard 样式统一 + 群聊 P0 修复)#2262
1688mengdie wants to merge 451 commits into
GCWing:mainfrom
1688mengdie:custom/taiji-unofficial

Conversation

@1688mengdie

Copy link
Copy Markdown

同步内容

taiji 定制版(custom/taiji-unofficial)同步最新基线 \8d810b99e\(相对上次合并基线 aa98261 前进,含上游合流 9b05dd0)。

本 PR 新增关键提交

  • \8d810b99e\ feat(UI): unify LegionCard style with CoreAgentCard surface
  • \2ba9a7ecd\ fix(P0): group chat auto-creates Claw session for missing member
  • \5b9999431\ fix(CI): gate local_download_name_key test import to platforms that use it
  • 上游合流 9b05dd0(centralize default feature ownership)+ dmg branding + harmonyos fixes

验证

  • 前端 type-check:web → 0 error
  • 前端 vitest → 3381 tests 全绿
  • cargo check bitfun-core/cli/desktop(--jobs 4)→ 0 error
  • cargo test bitfun-core → 144 passed 0 failed

t added 30 commits August 15, 2026 10:55
…on 根因修复

- P0-1 (coordinator.rs): register_session_tree_edge_idempotent 补缺失 } + DialogTurnStopDisposition 前空行 + trigger_source 字段补 None + 未使用 import 清理
- P0-2 (scheduler.rs): 补 ActiveDialogTurnTakeResult::Matched 分支 notify_waiters(active_turn_retired 通知缺失)+ goal_continuation match 非穷尽补 AbortForInterrupted 分支
- P1-1 (scheduler.rs): active_turn_retired.notify_waiters() 补发(Matched 分支)
- P1-2 (scheduler.rs): GoalContinuationAfterTurnAction::AbortForInterrupted 处理(interrupted turn 保持 goal 不继续)
- P1-3 (scheduler.rs): goal continuation 完整版实现(Evaluate 分支:prepare_goal_continuation_after_turn + submit_with_prepended_messages 重试循环 + MAX_THREAD_GOAL_AUTO_CONTINUATIONS)
- 重复字段清理 (execution_engine.rs/types.rs): ExecutionResult 移除 total_tools/duration_ms 重复字段
- DialogTurnData 补 recovery/recovery_epoch 字段 (group_room_tools.rs)
- turn admission 根因修复 (coordinator.rs): update_session_agent_binding 后刷新本地 session 快照,修复 TurnAdmissionSessionFacts 与 re-read session 不一致导致的 'Session execution settings changed during turn admission'(上游 1540b8a turn admission 重构引入)
- 测试注入修复: TEST_MODEL_RESOLUTION_AI_CONFIG.scope 注入(scheduler.rs 3 测试 + group_room_tools.rs 1 集成测试),适配上游 resolve_model_id_for_turn 需 config service

验证: cargo check -p bitfun-core --features product-full 0e0w (清缓存) + cargo check -p bitfun-sdk-host-app 0e0w + cargo check --workspace 0e0w + bitfun-core 2498 passed/0 failed + sdk-host 62 passed/0 failed
Upstream 975f2e7 + a056f54 + 8ea84ae(eb96fc6) + f6e72bb 等 6 提交:flow-chat tail blank / file explorer scroll / dsh-profile 编译路径 / openbitfun-host docs。
零冲突 auto-merge,5 交集文件(ci.yml/desktop-package.yml/check-build-prereqs.mjs/desktop-tauri-build.mjs/dev.cjs)本地定制自动合并保留。
(修复轮:1e1c58d50 单亲 commit 修正为双亲 merge commit)
# Conflicts:
#	src/web-ui/src/flow_chat/services/flow-chat-manager/EventHandlerModule.test.ts
#	src/web-ui/src/flow_chat/services/flow-chat-manager/EventHandlerModule.ts
# Conflicts:
#	src/crates/assembly/core/src/agentic/tools/implementations/group_room_tools.rs
根因:group_room_tools.rs:1648 missing_coordinator_yields_clear_error 依赖
「全局 coordinator 未被其他测试 set_global」(OnceLock 单次写入)。macos 并行
测试调度顺序与 win/ubuntu 不同:另一测试在「get_global 检查(None)」与
「call_impl 执行」之间 set_global → call_impl 返回 Ok → expect_err panic。

修复:coordinator.rs 新增测试门控全局锁 COORDINATOR_TEST_GLOBAL_LOCK
(OnceLock<Mutex<()>>)+ test_coordinator_access_lock_sync helper;
set_global 在 cfg(test) 下持锁执行;missing_coordinator_yields_clear_error
将「检查 get_global 为 None + call_impl」整体置于锁内原子执行,消除 TOCTOU
窗口。非测试构建零影响(cfg 门控,C-11)。
Upstream: 66ec398 fix(chat): make remote workspace file mentions reliable (GCWing#2313) + 3100bbb fix(web-ui): prevent scene transition overlap + 14a822f fix(peer): stop reconcile from erasing a session after a device switch

Conflict resolution (原则③两侧并存): UserMessageEditComposer/UserMessageItem/ChatInput workspaceId 删除 + remoteConnectionId 新增融合
- coordinator: forward turn user_message_metadata groupId into tool
  context_vars (both normal and recovered turn paths) so the calling
  member session carries the group context
- tool_context_runtime: propagate context_vars groupId into tool
  custom_data (camelCase key, zero pollution when absent)
- session_message_tool: build GroupChatForwardMetadata from custom_data
  groupId instead of always default() when submitting forwarded turns;
  non-group callers stay None (no fallback)
- tests: group_context carries group id when present / stays None without
  group context / ignores blank or non-string group id
…r L0), not the group session

Owner messages were attributed to the group session itself (sender_session_id
= groupId), so bubbles rendered as '[Agent L0] <group name>'. Plan B:
- Frontend send_group_message passes sender_session_id = '__master__'
  (GROUP_MASTER_ACTOR reserved word, local_customizations.rs:96).
- Backend resolve_sender_identity special-cases __master__: role = Commander
  (AgentRole enum, no hardcoded string), depth = 0 (L0), name = localized
  owner term 'agents.master' via the shared i18n term catalog (zh-CN 主人 /
  zh-TW 主人 / en-US Master); i18n-runtime disabled or service missing falls
  back to 'Master' (fail-closed, AGENTS-CN.md), never an empty name.
- Empty-value defense: when the master name is unavailable, senderName falls
  back to group_id (no crash); member fallback stays sender_session_id.
- Group-owner (agent) replies are unchanged (real start_dialog_turn turns).
- Adds i18n shared terms agents.master across zh-CN/zh-TW/en-US and
  regenerates the 5 generated locale contract files.
- Tests: 4 new master-identity unit tests (Commander L0, i18n term, group_id
  fallback, __master__ recognition); frontend send assertion now expects
  '__master__'.
loadMembers walked only the single workspacePath with listSessions, so a
member persisted in another assistant workspace resolved to nothing and the
member table rendered raw UUIDs. Walk workspacePath + every assistant
workspace rootPath (same shape as CreateGroupChatDialog.loadMembers),
dedupe by sessionId (first root wins), per-root failures degrade to [],
and missing ids fall back to their raw session id in memberRows. Adds a
stable assistantWorkspacesRef (R-GC-19 pattern) so loadMembers keeps a
stable identity.

Tests: cross-root member shows real name + same-root member does not fall
back; unknown id falls back to the raw id without crashing.
- validate_session_exists: 内存 get_session 缺失回退 resolve_session_workspace_binding 磁盘持久化校验(重启未加载不误拒)
- group_workspace: 内存缺失回退磁盘 binding 解析群 workspace(群操作不报 does not exist in memory,解死锁链)
- fork_group: members 为空默认登记子群自身到 groupChats(群主=子群自身,子群有群标记)
- delete_group: 删除前遍历成员清反标(成员会话 custom_metadata.groupChats 移除本群,清空移除键)
- 测试: run_restart_unloaded_fallback(evict 模拟重启)+ fork 空成员 list 识别 + delete 级联清断言
- 验证: bitfun-core product-full check 0e0w / 全量 lib 2504 passed
t added 17 commits August 20, 2026 21:55
- inference endpoint gateway.qoder.com.cn/model/v1/chat/completions (owner
  machine endpoint-cache verified; OpenAI-compatible, matches existing pipeline)
- PAT login flow: exchange PAT at openapi.qoder.com.cn/api/v1/jobToken/exchange
  for short-lived job token (qoderclicn source-verified); PAT stored as refresh
  marker pat|... and re-exchanged on expiry
- keep OAuth device flow as second channel (dual-channel)
- static CN model table (qoder-cn-proxy verified) for model discovery since
  api2-v2 has no public OpenAI /models
- remove Cosy-* headers (pi-free: api2-v2 is pure Bearer; CN gateway likewise)
- frontend PAT input + i18n (en/zh-CN/zh-TW)
…allback

react-hooks/exhaustive-deps error blocked CI zero-warning gate.
Model list discovery broke after the CN migration: the static Qoder model
catalog branch only matched api2-v2.qoder.sh, but the China-region gateway
is gateway.qoder.com.cn, so discovery fell through to a real /models request
that 404s. Match both gateways.
Persist and load of session metadata could resolve to different physical
sessions roots when canonicalization outcome changed between the create
(raw path, directory absent) and the update (canonical path, directory
present) calls on hosts where the raw path differs from its canonical
form (ubuntu /tmp timing). Unify project_sessions_dir on a canonical
form that is stable across the create/update boundary by canonicalizing
the nearest existing ancestor and re-appending the missing tail.

Also tolerate a poisoned PERSISTED_SESSION_TESTS_LOCK in the test guard:
one panicking persisted-session test previously poisoned the std Mutex
and cascaded 60 identical 'lock poisoned' failures that masked the real
root cause (61 failures -> 1 failure + 60 runnable siblings).

Verified: bitfun-core lib 2593 passed 0 failed; clippy 0 warnings; fmt clean.
…id passthrough

- Add session_id: Option<String> to ModelRequestContext (core-types/ai.rs)
- Pass session.session_id at execution_engine construction points (L3399/L4537)
- Forward request_context through OpenAIChat branch in client.rs
- Inject X-Conversation-ID/X-Conversation-Request-ID/X-Request-ID/
  X-Conversation-Message-ID headers in chat.rs when URL contains
  copilot.tencent.com (CodeBuddy endpoint detection)
- generate_hex32() uses SHA-256(counter+timestamp) for unique 32-hex IDs
- Non-CodeBuddy URLs unaffected (no header injection)
- Unit tests: ModelRequestContext session_id round-trip, generate_hex32
  format/uniqueness, CodeBuddy URL detection

R-CB-HEADER: session_id passthrough pipeline + request-level header injection
实证清单:
1. types.rs:595-597 添加 pub todos: Option<serde_json::Value>(serde default)
2. types.rs:1262 构造点修复(todos: None)
3. save_dialog_turn/load_session_turns 自动序列化/反序列化 todos
4. vitest 四场景全绿(182 tests passed,mock 对齐真实后端)
5. cargo check/clippy 通过(7 预存 warning,无新增)
6. fmt --check 本次改动合规

禁假实现/声称失实,逐行核实。
实证清单:
1. FlowChatStore.ts:9367-9383 getTodos 改为取 latest non-empty turn's todos
2. 禁 concat 所有 turn,确保删除后不残留、多轮替换取最新
3. vitest 新增 2 个 getTodos 聚合用例(删除不残留/多轮取最新)
4. 总计 184 tests passed(含既有 178)

Fix root cause 3: getTodos aggregates all turn todos → takes latest valid turn only
@1688mengdie
1688mengdie force-pushed the custom/taiji-unofficial branch from f9f70be to a7d3a18 Compare August 21, 2026 07:43
t added 12 commits August 21, 2026 15:51
三重断链根治 + CodeBuddy 思考档位支持:
1. 数据源:RemoteModelInfo 增加 supports_reasoning 字段,map_model_entries 保留
   CodeBuddy 的 supportsReasoning(全仓审计所有构造点补 None)
2. 前端:syncSelectedModelDrafts 按 supports_reasoning=true 为模型 draft 设置
   reasoning 默认 default_preset=on;offering 模型透传 supports_reasoning
3. 后端兜底+档位:adapter 识别 copilot.tencent.com,生成 on/off toggle +
   high/max effort 档位 preset;compile_chat_reasoning_action 对 CodeBuddy
   注入 enable_thinking + reasoning_effort(CodeBuddy 思考为档位可调)

验证:cargo check/clippy/fmt 全绿,ai-adapters 245 tests,前端 type-check +
3893 vitest 全绿
- begin_login: fetch_account 失败时记录 warn 日志,不再静默忽略错误
- list_models: enterprise_id 缺失时记录 warn 日志,明确降级路径
- list_models: 改进 fallback 逻辑,优先 /v3/config(有认证即可)
- list_models: 静态兜底时记录 warn 日志,包含模型数量
- 新增测试:enterprise_id_missing_logs_warning 验证降级行为
- 全量验证:cargo check/clippy/fmt --check + 前端 type-check 全部通过
…ng#2421-GCWing#2423, miniapp/skin market download funnel, set-build-version drop --offline)

Sync upstream/main d5f3c5e: 6 commits (GCWing#2423 beta-build cargo update online / GCWing#2421 miniapp-market download button / drop --offline from workspace lockfile sync / skin-market pnpm patches / skin+miniapp market funnel visitors to download page). Zero conflicts; local customizations (Cargo.lock ratatui/bitflags/image, skin-market-server Cargo.toml) untouched.
…in-host integration GCWing#2424)

Sync upstream/main 41f4af3: 2 commits (feat: integrate managed opencode plugin host / fix: gate execution and close lifecycle gaps). Conflicts resolved per four principles: .gitignore/package.json/main.rs/lib.rs kept both sides (local KB-root injection + upstream plugin-host init); Cargo.lock/Cargo.toml auto-merged cleanly; local customizations (ratatui/bitflags/image, package:windows assets) preserved.
…n non-Windows

Upstream 41f4af3 introduced plugin_host.rs where comparable_instance_directory
declares mut only consumed by the #[cfg(windows)] branch; non-Windows builds
trip our CI's -D warnings (unused_mut). Minimal local fix: #[allow(unused_mut)].
Behavior unchanged on Windows.
…ect official fingerprint headers

R-CB-CONVID: CodeBuddy conversation IDs were not aggregated by the
backend because:
1. X-Conversation-Request-ID was regenerated per request; official
   semantics group every request of one user turn under one value.
   Now derived from dialog_turn_id (turn-stable, retries included).
2. Missing official fingerprint headers (X-Agent-Intent: craft,
   X-Agent-Purpose: conversation, X-Product: SaaS, X-IDE-Type/Name/
   Version, X-Product-Version, X-Requested-With) which the backend
   uses to recognize an aggregatable conversation.

ModelRequestContext gains conversation_request_id; only the
copilot.tencent.com branch in chat.rs is affected. Verified:
cargo check --workspace 0 errors, clippy 0 warnings, fmt clean,
unit tests green (incl. 4 new CodeBuddy header tests), web-ui
type-check green.
…rint values

CPO correction (owner-verified): X-IDE-Version must be the official
CodeBuddy CLI version (2.137.1 per @tencent-ai/codebuddy-code
package.json), not BitFun's own version. Also corrected X-IDE-Name to
the official value 'CLI' (clientInfoProvider platform fallback =
PRODUCT_TYPE='CLI'), not the binary name 'codebuddy'. Verified against
codebuddy.js module 33387 + clientInfoProvider impl.
…t cleanup in webview recovery

Upstream 41f4af3 (managed opencode plugin host) exposed three -D warnings
failures on Windows CI that upstream's own CI does not gate on:
1. self_update.rs: validate_plugin_host_resources/copy_plugin_host_resources
   are only called from #[cfg(unix)] install paths; gate definitions with
   #[cfg(unix)] (upstream missed the gate).
2. webview_recovery.rs: upstream refactored perform_process_exit_cleanup from
   fn to async fn; the three sync call sites in the local recovery flow now
   spawn the future via tauri::async_runtime::spawn (matching upstream's own
   call pattern in lib.rs) instead of dropping it (unused_must_use).
Verified: cargo check -D warnings for bitfun-cli and bitfun-desktop pass.
…tion

Upstream e9c09b0/41f4af303 and the codebuddy conversation-ID work left
three test-build breakages that only surface under cargo test -D warnings:
1. execution_engine.rs: model_request_context gained a third arg
   (dialog_turn_id) but the provider_prompt_cache_route_key test still
   passed two; add the turn id.
2. plugin_host_http_routes.rs: DialogTurnData gained a todos field
   (Option<serde_json::Value>) but the assistant_parts test initializer
   omitted it; add todos: None.
3. product_runtime.rs: fork_session_for_plugin is only called from the
   opencode-plugin-host feature (plugin_host_http_routes_impl), but the
   function itself was un-gated, so non-feature builds (SDK Host tests)
   hit dead-code under -D warnings; gate it with cfg(feature = "opencode-plugin-host").
Verified locally: cargo check -D warnings for bitfun-sdk-host +
bitfun-sdk-host-app and bitfun-cli/desktop pass; bitfun-core lib test compiles.
…l opencode protocol

Serde camelCase rename_all only accepts parentId, but the official opencode protocol uses parentID (capital ID); clients sending parentID had it silently ignored, so parent_id stayed None and session_create did not reject parent sessions as required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants