Compare commits

...

6 Commits

Author SHA1 Message Date
ff7108738e fix(style): 去除审批面板边缘光晕
desktop-approval-sheet 的 box-shadow 从大范围彩色扩散光晕
替换为项目既有的 var(--shadow-strong) 中性克制投影。
2026-06-09 11:46:20 +08:00
d5bf110b88 fix(style): 修复弹窗和审批面板文字颜色在深色模式下的异常显示
- confirm-title 添加 color: var(--text-primary)
- confirm-button--primary 使用 var(--on-accent) 替代 var(--text-primary),
  修复浅色模式下黑底黑字不可读
- 审批面板 auto-approval-block 标题/内容/决策/原因 补充显式颜色
- 审批面板 approval-lines/approval-diff/approval-kv strong/approval-value
  补充显式颜色,避免深色模式下继承为浅金色
2026-06-09 11:45:51 +08:00
033bea236c feat(ui): 预输入/引导消息队列存在时自动隐藏Git状态栏
与 / 菜单出现时隐藏逻辑相同,在 floatingStatusVisible 中新增
runtimeQueuedMessages 和 hasPendingRuntimeGuidance 两项检查。
2026-06-09 11:42:37 +08:00
59b81c4551 fix(git): 修复Git变更面板中文文件名八进制转义显示
_run_project_git / _run_project_git_raw 添加 -c core.quotePath=false,
让 git 直接输出 UTF-8 原始路径名而非八进制转义形式。
2026-06-09 11:42:20 +08:00
a2a04b9529 fix(permission): 新建对话时优先加载个人空间偏好的默认权限模式
- core/web_terminal.py: create_new_conversation 中反转权限模式优先级,
  优先使用 prefs.default_permission_mode,无效时再 fallback 到终端当前模式
- server/conversation.py: active_task 分支创建视图对话时同样使用用户偏好
2026-06-09 11:42:08 +08:00
bd338f7ad4 fix(runtime): 任务完成时不再注入权限/审核方式通知
模型准备结束工作时,队列中残留的权限/审核方式变更通知不应再
插入对话。改用 consume_runtime_guidance_for_injection 保留 source
信息,过滤掉 source 为'权限变更/执行环境变更/notify'的消息。
2026-06-09 11:41:55 +08:00
9 changed files with 47 additions and 12 deletions

View File

@ -130,13 +130,14 @@ class WebTerminal(MainTerminal):
logger.warning("忽略无效默认模型 %s: %s", preferred_model, exc)
preferred_mode = prefs.get("default_run_mode")
preferred_permission_mode = None
preferred_permission_mode = prefs.get("default_permission_mode") or None
if preferred_permission_mode not in ("readonly", "approval", "auto_approval", "unrestricted"):
try:
preferred_permission_mode = self.get_permission_mode()
except Exception:
preferred_permission_mode = None
if not isinstance(preferred_permission_mode, str) or not preferred_permission_mode.strip():
preferred_permission_mode = prefs.get("default_permission_mode") or "unrestricted"
preferred_permission_mode = "unrestricted"
if isinstance(preferred_mode, str) and preferred_mode.lower() in {"fast", "thinking", "deep"}:
try:
self.set_run_mode(preferred_mode.lower())

View File

@ -1699,10 +1699,25 @@ async def handle_task_with_sender(
try:
from .tasks import task_manager
pending_runtime_guidance_messages = task_manager.consume_runtime_guidance_messages(
raw_items = task_manager.consume_runtime_guidance_for_injection(
username=username,
task_id=client_sid,
)
# 权限/审核方式变更通知在任务完成时不应该触发新一轮工作,
# 只保留真正的引导消息(压缩续接等),丢弃权限/执行环境变更通知。
runtime_skip_sources = {"权限变更", "执行环境变更", "notify"}
for item in (raw_items or []):
if isinstance(item, dict):
src = str(item.get("source") or "").strip().lower()
text = str(item.get("text") or "").strip()
if src in runtime_skip_sources:
continue
if text:
pending_runtime_guidance_messages.append(text)
else:
text = str(item or "").strip()
if text:
pending_runtime_guidance_messages.append(text)
except Exception as exc:
debug_log(f"[RuntimeGuidance] 读取剩余引导消息失败: {exc}")
pending_runtime_guidance_messages = []

View File

@ -482,6 +482,9 @@ def create_conversation(terminal: WebTerminal, workspace: UserWorkspace, usernam
safe_run_mode = candidate if candidate in {"fast", "thinking", "deep"} else "fast"
safe_thinking = bool(thinking_mode) if thinking_mode is not None else safe_run_mode != "fast"
previous_cm_current = getattr(cm, "current_conversation_id", None)
default_permission_mode = (prefs or {}).get("default_permission_mode")
if default_permission_mode not in ("readonly", "approval", "auto_approval", "unrestricted"):
default_permission_mode = None
conversation_id = cm.create_conversation(
project_path=str(workspace.project_path),
thinking_mode=safe_thinking,
@ -489,7 +492,7 @@ def create_conversation(terminal: WebTerminal, workspace: UserWorkspace, usernam
initial_messages=[],
model_key=(prefs or {}).get("default_model") or getattr(terminal, "model_key", None),
metadata_overrides={
"permission_mode": getattr(terminal, "get_permission_mode", lambda: "unrestricted")(),
"permission_mode": default_permission_mode or getattr(terminal, "get_permission_mode", lambda: "unrestricted")(),
"execution_mode": getattr(terminal, "get_execution_mode", lambda: "sandbox")(),
},
)

View File

@ -140,7 +140,7 @@ def _run_project_git(project_path: Path, args: list[str]) -> tuple[bool, str]:
return False, ""
try:
proc = subprocess.run(
[git_bin, "-C", str(project_path), *args],
[git_bin, "-c", "core.quotePath=false", "-C", str(project_path), *args],
cwd=str(project_path),
text=True,
stdout=subprocess.PIPE,
@ -159,7 +159,7 @@ def _run_project_git_raw(project_path: Path, args: list[str], timeout: int = 4)
return False, ""
try:
proc = subprocess.run(
[git_bin, "-C", str(project_path), *args],
[git_bin, "-c", "core.quotePath=false", "-C", str(project_path), *args],
cwd=str(project_path),
text=True,
stdout=subprocess.PIPE,

View File

@ -305,6 +305,7 @@
:current-context-tokens="currentContextTokens"
:versioning-enabled="versioningEnabled"
:runtime-queued-messages="runtimeQueuedMessages"
:has-pending-runtime-guidance="runtimeGuidanceFallbackQueue.length > 0"
:project-git-summary="projectGitSummary"
:user-question-minimized="userQuestionMinimized"
:pending-user-question-count="pendingUserQuestions.length"

View File

@ -515,6 +515,7 @@ const props = defineProps<{
goalModeArmed?: boolean;
goalRunning?: boolean;
goalProgress?: Record<string, any> | null;
hasPendingRuntimeGuidance?: boolean;
}>();
const inputStore = useInputStore();
@ -598,6 +599,8 @@ const projectGitSummaryForRender = computed(() => {
const floatingStatusVisible = computed(() => {
if (skillSlashMenuOpen.value || props.quickMenuOpen) return false;
// /git /
if (runtimeQueuedMessagesForRender.value.length > 0 || props.hasPendingRuntimeGuidance) return false;
return (
!!projectGitSummaryForRender.value ||
!!props.goalRunning ||

View File

@ -257,6 +257,7 @@ const parseFinalMessage = (text: string) => {
font-size: 13px;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
.auto-approval-block__content {
@ -265,6 +266,7 @@ const parseFinalMessage = (text: string) => {
line-height: 1.5;
white-space: pre-wrap;
word-break: break-word;
color: var(--text-secondary);
}
.auto-approval-block__final {
@ -276,6 +278,7 @@ const parseFinalMessage = (text: string) => {
.auto-approval-block__decision {
font-weight: 700;
margin-bottom: 4px;
color: var(--text-primary);
}
.auto-approval-block__decision--approved {
@ -289,6 +292,7 @@ const parseFinalMessage = (text: string) => {
.auto-approval-block__reason {
white-space: pre-wrap;
word-break: break-word;
color: var(--text-secondary);
}
.tool-approval-panel.is-goal-approval-mode .auto-approval-block {

View File

@ -1916,7 +1916,7 @@
height: 100%;
max-width: 92vw;
background: var(--claude-panel);
box-shadow: -10px 0 28px color-mix(in srgb, var(--text-primary) 22%, transparent);
box-shadow: var(--shadow-strong);
overflow: hidden;
display: flex;
flex-direction: column;
@ -1994,6 +1994,7 @@
font-size: 16px;
font-weight: 600;
margin-bottom: 12px;
color: var(--text-primary);
}
.confirm-message {
@ -2037,7 +2038,7 @@
.confirm-button--primary {
background: var(--claude-accent);
border-color: var(--claude-accent-strong);
color: var(--text-primary);
color: var(--on-accent);
}
.confirm-button--danger {

View File

@ -605,6 +605,7 @@ body[data-theme='dark'] .git-change-file__open-icon {
white-space: pre-wrap;
word-break: break-word;
background: var(--theme-surface-muted);
color: var(--text-primary);
scrollbar-width: none;
-ms-overflow-style: none;
}
@ -616,6 +617,7 @@ body[data-theme='dark'] .git-change-file__open-icon {
.approval-diff {
margin-top: 12px;
color: var(--text-primary);
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
font-size: 12px;
line-height: 1.5;
@ -648,12 +650,14 @@ body[data-theme='dark'] .git-change-file__open-icon {
.approval-kv strong {
white-space: nowrap;
color: var(--text-primary);
}
.approval-value {
white-space: normal;
overflow-wrap: anywhere;
word-break: break-word;
color: var(--text-primary);
}
.approval-note {
@ -665,16 +669,19 @@ body[data-theme='dark'] .git-change-file__open-icon {
.approval-lines--old {
background: color-mix(in srgb, var(--claude-warning) 18%, transparent);
border: 1px solid color-mix(in srgb, var(--claude-warning) 50%, transparent);
color: var(--text-primary);
}
.approval-lines--new {
background: color-mix(in srgb, var(--claude-success) 18%, transparent);
border: 1px solid color-mix(in srgb, var(--claude-success) 50%, transparent);
color: var(--text-primary);
}
.approval-lines--cmd,
.approval-lines--generic {
background: var(--theme-surface-muted);
color: var(--text-primary);
}
.tool-approval-panel .diff-line {