Compare commits

..

No commits in common. "ff7108738e45f6980348ca866ba402670dbe47ff" and "8d87068ba76849bc569389e3c753a0774261b295" have entirely different histories.

9 changed files with 12 additions and 47 deletions

View File

@ -130,14 +130,13 @@ class WebTerminal(MainTerminal):
logger.warning("忽略无效默认模型 %s: %s", preferred_model, exc)
preferred_mode = prefs.get("default_run_mode")
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
preferred_permission_mode = None
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 = "unrestricted"
preferred_permission_mode = prefs.get("default_permission_mode") or "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,25 +1699,10 @@ async def handle_task_with_sender(
try:
from .tasks import task_manager
raw_items = task_manager.consume_runtime_guidance_for_injection(
pending_runtime_guidance_messages = task_manager.consume_runtime_guidance_messages(
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,9 +482,6 @@ 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,
@ -492,7 +489,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": default_permission_mode or getattr(terminal, "get_permission_mode", lambda: "unrestricted")(),
"permission_mode": 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", "core.quotePath=false", "-C", str(project_path), *args],
[git_bin, "-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", "core.quotePath=false", "-C", str(project_path), *args],
[git_bin, "-C", str(project_path), *args],
cwd=str(project_path),
text=True,
stdout=subprocess.PIPE,

View File

@ -305,7 +305,6 @@
: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,7 +515,6 @@ const props = defineProps<{
goalModeArmed?: boolean;
goalRunning?: boolean;
goalProgress?: Record<string, any> | null;
hasPendingRuntimeGuidance?: boolean;
}>();
const inputStore = useInputStore();
@ -599,8 +598,6 @@ 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,7 +257,6 @@ const parseFinalMessage = (text: string) => {
font-size: 13px;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
.auto-approval-block__content {
@ -266,7 +265,6 @@ const parseFinalMessage = (text: string) => {
line-height: 1.5;
white-space: pre-wrap;
word-break: break-word;
color: var(--text-secondary);
}
.auto-approval-block__final {
@ -278,7 +276,6 @@ const parseFinalMessage = (text: string) => {
.auto-approval-block__decision {
font-weight: 700;
margin-bottom: 4px;
color: var(--text-primary);
}
.auto-approval-block__decision--approved {
@ -292,7 +289,6 @@ 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: var(--shadow-strong);
box-shadow: -10px 0 28px color-mix(in srgb, var(--text-primary) 22%, transparent);
overflow: hidden;
display: flex;
flex-direction: column;
@ -1994,7 +1994,6 @@
font-size: 16px;
font-weight: 600;
margin-bottom: 12px;
color: var(--text-primary);
}
.confirm-message {
@ -2038,7 +2037,7 @@
.confirm-button--primary {
background: var(--claude-accent);
border-color: var(--claude-accent-strong);
color: var(--on-accent);
color: var(--text-primary);
}
.confirm-button--danger {

View File

@ -605,7 +605,6 @@ 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;
}
@ -617,7 +616,6 @@ 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;
@ -650,14 +648,12 @@ 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 {
@ -669,19 +665,16 @@ 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 {