Compare commits
No commits in common. "ff7108738e45f6980348ca866ba402670dbe47ff" and "8d87068ba76849bc569389e3c753a0774261b295" have entirely different histories.
ff7108738e
...
8d87068ba7
@ -130,14 +130,13 @@ class WebTerminal(MainTerminal):
|
|||||||
logger.warning("忽略无效默认模型 %s: %s", preferred_model, exc)
|
logger.warning("忽略无效默认模型 %s: %s", preferred_model, exc)
|
||||||
|
|
||||||
preferred_mode = prefs.get("default_run_mode")
|
preferred_mode = prefs.get("default_run_mode")
|
||||||
preferred_permission_mode = prefs.get("default_permission_mode") or None
|
preferred_permission_mode = None
|
||||||
if preferred_permission_mode not in ("readonly", "approval", "auto_approval", "unrestricted"):
|
try:
|
||||||
try:
|
preferred_permission_mode = self.get_permission_mode()
|
||||||
preferred_permission_mode = self.get_permission_mode()
|
except Exception:
|
||||||
except Exception:
|
preferred_permission_mode = None
|
||||||
preferred_permission_mode = None
|
|
||||||
if not isinstance(preferred_permission_mode, str) or not preferred_permission_mode.strip():
|
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"}:
|
if isinstance(preferred_mode, str) and preferred_mode.lower() in {"fast", "thinking", "deep"}:
|
||||||
try:
|
try:
|
||||||
self.set_run_mode(preferred_mode.lower())
|
self.set_run_mode(preferred_mode.lower())
|
||||||
|
|||||||
@ -1699,25 +1699,10 @@ async def handle_task_with_sender(
|
|||||||
try:
|
try:
|
||||||
from .tasks import task_manager
|
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,
|
username=username,
|
||||||
task_id=client_sid,
|
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:
|
except Exception as exc:
|
||||||
debug_log(f"[RuntimeGuidance] 读取剩余引导消息失败: {exc}")
|
debug_log(f"[RuntimeGuidance] 读取剩余引导消息失败: {exc}")
|
||||||
pending_runtime_guidance_messages = []
|
pending_runtime_guidance_messages = []
|
||||||
|
|||||||
@ -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_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"
|
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)
|
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(
|
conversation_id = cm.create_conversation(
|
||||||
project_path=str(workspace.project_path),
|
project_path=str(workspace.project_path),
|
||||||
thinking_mode=safe_thinking,
|
thinking_mode=safe_thinking,
|
||||||
@ -492,7 +489,7 @@ def create_conversation(terminal: WebTerminal, workspace: UserWorkspace, usernam
|
|||||||
initial_messages=[],
|
initial_messages=[],
|
||||||
model_key=(prefs or {}).get("default_model") or getattr(terminal, "model_key", None),
|
model_key=(prefs or {}).get("default_model") or getattr(terminal, "model_key", None),
|
||||||
metadata_overrides={
|
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")(),
|
"execution_mode": getattr(terminal, "get_execution_mode", lambda: "sandbox")(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@ -140,7 +140,7 @@ def _run_project_git(project_path: Path, args: list[str]) -> tuple[bool, str]:
|
|||||||
return False, ""
|
return False, ""
|
||||||
try:
|
try:
|
||||||
proc = subprocess.run(
|
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),
|
cwd=str(project_path),
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
@ -159,7 +159,7 @@ def _run_project_git_raw(project_path: Path, args: list[str], timeout: int = 4)
|
|||||||
return False, ""
|
return False, ""
|
||||||
try:
|
try:
|
||||||
proc = subprocess.run(
|
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),
|
cwd=str(project_path),
|
||||||
text=True,
|
text=True,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
|
|||||||
@ -305,7 +305,6 @@
|
|||||||
:current-context-tokens="currentContextTokens"
|
:current-context-tokens="currentContextTokens"
|
||||||
:versioning-enabled="versioningEnabled"
|
:versioning-enabled="versioningEnabled"
|
||||||
:runtime-queued-messages="runtimeQueuedMessages"
|
:runtime-queued-messages="runtimeQueuedMessages"
|
||||||
:has-pending-runtime-guidance="runtimeGuidanceFallbackQueue.length > 0"
|
|
||||||
:project-git-summary="projectGitSummary"
|
:project-git-summary="projectGitSummary"
|
||||||
:user-question-minimized="userQuestionMinimized"
|
:user-question-minimized="userQuestionMinimized"
|
||||||
:pending-user-question-count="pendingUserQuestions.length"
|
:pending-user-question-count="pendingUserQuestions.length"
|
||||||
|
|||||||
@ -515,7 +515,6 @@ const props = defineProps<{
|
|||||||
goalModeArmed?: boolean;
|
goalModeArmed?: boolean;
|
||||||
goalRunning?: boolean;
|
goalRunning?: boolean;
|
||||||
goalProgress?: Record<string, any> | null;
|
goalProgress?: Record<string, any> | null;
|
||||||
hasPendingRuntimeGuidance?: boolean;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const inputStore = useInputStore();
|
const inputStore = useInputStore();
|
||||||
@ -599,8 +598,6 @@ const projectGitSummaryForRender = computed(() => {
|
|||||||
|
|
||||||
const floatingStatusVisible = computed(() => {
|
const floatingStatusVisible = computed(() => {
|
||||||
if (skillSlashMenuOpen.value || props.quickMenuOpen) return false;
|
if (skillSlashMenuOpen.value || props.quickMenuOpen) return false;
|
||||||
// 消息队列(预输入/引导消息)存在时隐藏git状态栏,与 / 菜单出现时逻辑相同
|
|
||||||
if (runtimeQueuedMessagesForRender.value.length > 0 || props.hasPendingRuntimeGuidance) return false;
|
|
||||||
return (
|
return (
|
||||||
!!projectGitSummaryForRender.value ||
|
!!projectGitSummaryForRender.value ||
|
||||||
!!props.goalRunning ||
|
!!props.goalRunning ||
|
||||||
|
|||||||
@ -257,7 +257,6 @@ const parseFinalMessage = (text: string) => {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.auto-approval-block__content {
|
.auto-approval-block__content {
|
||||||
@ -266,7 +265,6 @@ const parseFinalMessage = (text: string) => {
|
|||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
color: var(--text-secondary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.auto-approval-block__final {
|
.auto-approval-block__final {
|
||||||
@ -278,7 +276,6 @@ const parseFinalMessage = (text: string) => {
|
|||||||
.auto-approval-block__decision {
|
.auto-approval-block__decision {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.auto-approval-block__decision--approved {
|
.auto-approval-block__decision--approved {
|
||||||
@ -292,7 +289,6 @@ const parseFinalMessage = (text: string) => {
|
|||||||
.auto-approval-block__reason {
|
.auto-approval-block__reason {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
color: var(--text-secondary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool-approval-panel.is-goal-approval-mode .auto-approval-block {
|
.tool-approval-panel.is-goal-approval-mode .auto-approval-block {
|
||||||
|
|||||||
@ -1916,7 +1916,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
max-width: 92vw;
|
max-width: 92vw;
|
||||||
background: var(--claude-panel);
|
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;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -1994,7 +1994,6 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-message {
|
.confirm-message {
|
||||||
@ -2038,7 +2037,7 @@
|
|||||||
.confirm-button--primary {
|
.confirm-button--primary {
|
||||||
background: var(--claude-accent);
|
background: var(--claude-accent);
|
||||||
border-color: var(--claude-accent-strong);
|
border-color: var(--claude-accent-strong);
|
||||||
color: var(--on-accent);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.confirm-button--danger {
|
.confirm-button--danger {
|
||||||
|
|||||||
@ -605,7 +605,6 @@ body[data-theme='dark'] .git-change-file__open-icon {
|
|||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
background: var(--theme-surface-muted);
|
background: var(--theme-surface-muted);
|
||||||
color: var(--text-primary);
|
|
||||||
scrollbar-width: none;
|
scrollbar-width: none;
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
}
|
}
|
||||||
@ -617,7 +616,6 @@ body[data-theme='dark'] .git-change-file__open-icon {
|
|||||||
|
|
||||||
.approval-diff {
|
.approval-diff {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
color: var(--text-primary);
|
|
||||||
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
@ -650,14 +648,12 @@ body[data-theme='dark'] .git-change-file__open-icon {
|
|||||||
|
|
||||||
.approval-kv strong {
|
.approval-kv strong {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.approval-value {
|
.approval-value {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.approval-note {
|
.approval-note {
|
||||||
@ -669,19 +665,16 @@ body[data-theme='dark'] .git-change-file__open-icon {
|
|||||||
.approval-lines--old {
|
.approval-lines--old {
|
||||||
background: color-mix(in srgb, var(--claude-warning) 18%, transparent);
|
background: color-mix(in srgb, var(--claude-warning) 18%, transparent);
|
||||||
border: 1px solid color-mix(in srgb, var(--claude-warning) 50%, transparent);
|
border: 1px solid color-mix(in srgb, var(--claude-warning) 50%, transparent);
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.approval-lines--new {
|
.approval-lines--new {
|
||||||
background: color-mix(in srgb, var(--claude-success) 18%, transparent);
|
background: color-mix(in srgb, var(--claude-success) 18%, transparent);
|
||||||
border: 1px solid color-mix(in srgb, var(--claude-success) 50%, transparent);
|
border: 1px solid color-mix(in srgb, var(--claude-success) 50%, transparent);
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.approval-lines--cmd,
|
.approval-lines--cmd,
|
||||||
.approval-lines--generic {
|
.approval-lines--generic {
|
||||||
background: var(--theme-surface-muted);
|
background: var(--theme-surface-muted);
|
||||||
color: var(--text-primary);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tool-approval-panel .diff-line {
|
.tool-approval-panel .diff-line {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user