Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(auto_harness): Disable auto harness feature

ray_le8255f7e1c409
diff --git a/docs/en/SlashCommands.md b/docs/en/SlashCommands.md
index a2c8a4589e..da11ca48d0 100644
--- a/docs/en/SlashCommands.md
+++ b/docs/en/SlashCommands.md
@@ -567,53 +567,6 @@ Use the following template to write commands. `input=$(cat)` reads JSON into a v
---
-
-### `/auto-harness` (Task Management)
-
-Manage Auto-Harness task execution with support for both one-time and scheduled recurring modes.
-
-#### Subcommands
-
-| Command | Description |
-|---|---|
-| `/auto-harness run <query>` | Execute a one-time task (runs immediately, no repetition after completion) |
-| `/auto-harness schedule start --interval <hours> [--immediate] <query>` | Create a scheduled task |
-| `/auto-harness schedule list` | List all tasks (includes one-time and scheduled tasks) |
-| `/auto-harness schedule status <task_id>` | View task details |
-| `/auto-harness schedule logs <task_id> [--current \| --history <n>]` | View execution logs |
-| `/auto-harness schedule cancel <task_id>` | Cancel currently running task |
-| `/auto-harness schedule delete <task_id>` | Delete task |
-
-#### Concepts
-
-- **One-time Task**: Executes immediately once, status becomes `completed` after finish, no repetition
-- **Scheduled Task**: An Auto-Harness task that automatically executes periodically at specified intervals
-- **Execution**: Each trigger produces a single execution with its own execution_id
-- **Log types**:
- - `--current`: Logs for the currently running execution
- - `--history 0`: Logs for the most recently completed execution
- - `--history 1`: Logs for the second most recent execution
-
-#### Configuration Requirements
-
-First-time use requires configuring the following git/gitcode information (auto-guided):
-- git.user_name: Git commit username
-- git.user_email: Git commit email
-- git.fork_owner: Fork repository owner
-- GitCode Access Token (can be configured via environment variable)
-
-#### Examples
-
-- `/auto-harness run Optimize Context Engine offload feature` — Execute a one-time task, no repetition after completion
-- `/auto-harness schedule start --interval 4 Optimize Context Engine offload feature` — Create a task that runs every 4 hours
-- `/auto-harness schedule start --interval 4 --immediate Optimize Context Engine offload feature` — Create task and execute immediately
-- `/auto-harness schedule list` — View all tasks
-- `/auto-harness schedule status sch_abc123` — View task details
-- `/auto-harness schedule logs sch_abc123 --current` — Stream current execution logs
-- `/auto-harness schedule logs sch_abc123 --history 0` — View most recent execution logs
-- `/auto-harness schedule cancel sch_abc123` — Cancel running task
-- `/auto-harness schedule delete sch_abc123` — Delete task
-
## Planned Features
| Command | Description |
diff --git "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md" "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
index 74463987bc..b91d69947a 100644
--- "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
+++ "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"
@@ -578,53 +578,6 @@
---
-
-### `/auto-harness`(任务管理)
-
-管理 Auto-Harness 任务执行,支持定时循环和一次性执行两种模式。
-
-#### 子命令
-
-| 命令 | 说明 |
-|---|---|
-| `/auto-harness run <query>` | 执行一次性任务(立即执行,完成后不重复) |
-| `/auto-harness schedule start --interval <hours> [--immediate] <query>` | 创建定时任务 |
-| `/auto-harness schedule list` | 列出所有任务(含一次性与定时任务) |
-| `/auto-harness schedule status <task_id>` | 查看任务详情 |
-| `/auto-harness schedule logs <task_id> [--current \| --history <n>]` | 查看执行日志 |
-| `/auto-harness schedule cancel <task_id>` | 取消正在执行的任务 |
-| `/auto-harness schedule delete <task_id>` | 删除任务 |
-
-#### 概念说明
-
-- **一次性任务(One-time Task)**:立即执行一次,完成后状态变为 `completed`,不会重复执行
-- **定时任务(Scheduled Task)**:按照指定间隔周期自动执行的 Auto-Harness 任务
-- **执行轮次(Execution)**:每次触发的单次执行,有独立的 execution_id
-- **日志类型**:
- - `--current`:当前正在执行的日志
- - `--history 0`:最新完成的执行日志
- - `--history 1`:倒数第二次执行日志
-
-#### 配置要求
-
-首次使用需要配置以下 git/gitcode 信息(会自动引导):
-- git.user_name:Git 提交用户名
-- git.user_email:Git 提交邮箱
-- git.fork_owner:Fork 仓库所有者
-- GitCode Access Token(可通过环境变量配置)
-
-#### 示例
-
-- `/auto-harness run 优化上下文工程卸载能力` — 执行一次性任务,完成后不再重复
-- `/auto-harness schedule start --interval 4 优化上下文工程卸载能力` — 创建每 4 小时执行一次的定时任务
-- `/auto-harness schedule start --interval 4 --immediate 优化上下文工程卸载能力` — 创建定时任务并立即执行一次
-- `/auto-harness schedule list` — 查看所有任务
-- `/auto-harness schedule status sch_abc123` — 查看任务详情
-- `/auto-harness schedule logs sch_abc123 --current` — 实时跟踪当前执行日志
-- `/auto-harness schedule logs sch_abc123 --history 0` — 查看最近一次执行日志
-- `/auto-harness schedule cancel sch_abc123` — 取消正在执行的任务
-- `/auto-harness schedule delete sch_abc123` — 删除任务
-
## 待开发
| 命令 | 说明 |
diff --git a/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts b/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts
index 1623447271..b54a6befae 100644
--- a/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts
+++ b/jiuwenclaw/channels/tui/frontend/src/core/commands/builtins/auto-harness.ts
@@ -849,10 +849,10 @@ function formatLogSection(section: ParsedLogSection): string | null {
// Skip duplicate content - if content equals display_name, don't show it again
const showContent = section.content && section.content !== stageDisplayName;
if (showContent) {
- const stageContent = section.content.length > 80
- ? section.content.substring(0, 80) + "..."
- : section.content;
- return `\n${startProgressBar}\n${ANSI.yellow}${ANSI.bold}▶ 📊 ${stageDisplayName}${ANSI.reset}\n${ANSI.yellow}${stageContent}${ANSI.reset}\n`;
+ // Wrap content to visual width (100 chars) and add indent
+ const wrappedContent = wrapText(section.content, 100);
+ const indentedContent = wrappedContent.split("\n").map(line => " " + line).join("\n");
+ return `\n${startProgressBar}\n${ANSI.yellow}${ANSI.bold}▶ 📊 ${stageDisplayName}${ANSI.reset}\n${ANSI.yellow}${indentedContent}${ANSI.reset}\n`;
}
// Only show progress bar and stage name
return `\n${startProgressBar}\n${ANSI.yellow}${ANSI.bold}▶ 📊 ${stageDisplayName}${ANSI.reset}\n`;
@@ -1185,7 +1185,10 @@ function formatLogSectionDetailed(section: ParsedLogSection): string | null {
// Skip duplicate content display
const showContentDetailed = section.content && section.content !== stageDisplayNameDetailed;
if (showContentDetailed) {
- return `\n${startProgressBarDetailed}\n${ANSI.yellow}${ANSI.bold}▶ 📊 ${stageDisplayNameDetailed}${ANSI.reset}\n${ANSI.yellow}${indentMultiline(section.content, " ", 300)}${ANSI.reset}\n`;
+ // Wrap content to visual width (100 chars) and add indent
+ const wrappedContentDetailed = wrapText(section.content, 100);
+ const indentedContentDetailed = wrappedContentDetailed.split("\n").map(line => " " + line).join("\n");
+ return `\n${startProgressBarDetailed}\n${ANSI.yellow}${ANSI.bold}▶ 📊 ${stageDisplayNameDetailed}${ANSI.reset}\n${ANSI.yellow}${indentedContentDetailed}${ANSI.reset}\n`;
}
return `\n${startProgressBarDetailed}\n${ANSI.yellow}${ANSI.bold}▶ 📊 ${stageDisplayNameDetailed}${ANSI.reset}\n`;
case "session_finished":
@@ -1213,17 +1216,6 @@ function formatLogSectionDetailed(section: ParsedLogSection): string | null {
}
}
-// Helper: indent multiline content
-function indentMultiline(text: string, prefix: string, maxLength: number): string {
- const lines = text.split("\n");
- const result: string[] = [];
- for (const line of lines) {
- const truncated = line.length > maxLength ? line.substring(0, maxLength) + "..." : line;
- result.push(prefix + truncated);
- }
- return result.join("\n");
-}
-
const scheduleCancelCommand: SlashCommand = {
name: "cancel",
description: "取消任务",
@@ -1399,6 +1391,7 @@ export function createAutoHarnessCommand(): SlashCommand {
return {
name: "auto-harness",
description: "Auto-Harness 任务管理",
+ hidden: true, // Temporarily hidden from TUI, core functionality preserved for future re-enable
kind: CommandKind.BUILT_IN,
takesArgs: true,
subCommands: [runCommand, scheduleCommand],
diff --git a/jiuwenclaw/channels/web/frontend/src/components/ChatPanel/InputArea.tsx b/jiuwenclaw/channels/web/frontend/src/components/ChatPanel/InputArea.tsx
index 83a4b5d63b..a0967aba98 100644
--- a/jiuwenclaw/channels/web/frontend/src/components/ChatPanel/InputArea.tsx
+++ b/jiuwenclaw/channels/web/frontend/src/components/ChatPanel/InputArea.tsx
@@ -47,7 +47,7 @@ export function InputArea({
const isTeamMode = mode === 'team';
const isAutoHarnessMode = mode === 'auto_harness';
const hasHistoryMessages = messages.length > 0;
- const modes: Array<{ value: AgentMode; label: string; icon: JSX.Element }> = [
+ const modes: Array<{ value: AgentMode; label: string; icon: JSX.Element; hidden?: boolean }> = [
{ value: 'agent.plan', label: t('chat.modePlan'), icon: (
<svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" />
@@ -67,7 +67,7 @@ export function InputArea({
<svg className="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={2}>
<path strokeLinecap="round" strokeLinejoin="round" d="M4.5 12a7.5 7.5 0 0015 0m-15 0a7.5 7.5 0 1115 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077l1.41-.513m14.095-5.13l1.41-.513M5.106 17.785l1.15-.964m11.69-9.765l1.15-.964m-3.093 5.25l.906-1.356m-6.768 1.356l.906-1.356M9 12H7.5m6.5 0H12m-1.5 0a1.5 1.5 0 103 0 1.5 1.5 0 00-3 0z" />
</svg>
- )},
+ ), hidden: true },
];
const {
@@ -265,7 +265,8 @@ export function InputArea({
: inputValue + pendingVoiceText;
const canSend = inputValue.trim().length > 0 || isListening;
- const modeIndex = Math.max(0, modes.findIndex((m) => m.value === mode));
+ const visibleModes = modes.filter((m) => !m.hidden);
+ const modeIndex = Math.max(0, visibleModes.findIndex((m) => m.value === mode));
const evolutionLabel = getEvolutionPillLabel(mode, evolutionStatus, t);
return (
@@ -345,10 +346,10 @@ export function InputArea({
<div className="chat-input-toolbar-left">
<div
className="chat-mode-switch"
- style={{ '--chat-mode-index': modeIndex } as CSSProperties}
+ style={{ '--chat-mode-count': visibleModes.length, '--chat-mode-index': modeIndex } as CSSProperties}
>
<div className="chat-mode-switch__indicator" />
- {modes.map((m) => (
+ {visibleModes.map((m) => (
<button
type="button"
key={m.value}
diff --git a/jiuwenclaw/channels/web/frontend/src/components/ExtensionsHubPanel/index.tsx b/jiuwenclaw/channels/web/frontend/src/components/ExtensionsHubPanel/index.tsx
index c0b2d0bb5f..a46d9c4ab2 100644
--- a/jiuwenclaw/channels/web/frontend/src/components/ExtensionsHubPanel/index.tsx
+++ b/jiuwenclaw/channels/web/frontend/src/components/ExtensionsHubPanel/index.tsx
@@ -13,6 +13,13 @@ import './ExtensionsHubPanel.css';
type HubTabKey = 'rails' | 'harnesspkg';
+interface TabItem {
+ key: HubTabKey;
+ label: string;
+ icon: JSX.Element;
+ hidden?: boolean;
+}
+
interface ExtensionsHubPanelProps {
sessionId: string;
isConnected: boolean;
@@ -20,34 +27,49 @@ interface ExtensionsHubPanelProps {
export function ExtensionsHubPanel({ sessionId, isConnected }: ExtensionsHubPanelProps) {
const { t } = useTranslation();
- const [activeTab, setActiveTab] = useState<HubTabKey>('harnesspkg');
+ const [activeTab, setActiveTab] = useState<HubTabKey>('rails');
+
+ const tabs: TabItem[] = [
+ {
+ key: 'harnesspkg',
+ label: t('nav.harnesspkg', 'Plugins'),
+ hidden: true, // Temporarily hidden from web UI, core functionality preserved for future re-enable
+ icon: (
+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth={1.5}>
+ <path strokeLinecap="round" strokeLinejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />
+ </svg>
+ ),
+ },
+ {
+ key: 'rails',
+ label: t('nav.rails', 'Extensions'),
+ icon: (
+ <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth={1.5}>
+ <path strokeLinecap="round" strokeLinejoin="round" d="M12 6v12m6-6H6" />
+ <circle cx="12" cy="12" r="9" />
+ </svg>
+ ),
+ },
+ ];
+
+ const visibleTabs = tabs.filter((tab) => !tab.hidden);
return (
<div className="extensions-hub-panel">
{/* Tab Header */}
<div className="extensions-hub-panel__header">
<div className="extensions-hub-panel__tabs">
- <button
- type="button"
- onClick={() => setActiveTab('harnesspkg')}
- className={`extensions-hub-panel__tab ${activeTab === 'harnesspkg' ? 'extensions-hub-panel__tab--active' : ''}`}
- >
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth={1.5}>
- <path strokeLinecap="round" strokeLinejoin="round" d="M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9" />
- </svg>
- <span>{t('nav.harnesspkg', 'Plugins')}</span>
- </button>
- <button
- type="button"
- onClick={() => setActiveTab('rails')}
- className={`extensions-hub-panel__tab ${activeTab === 'rails' ? 'extensions-hub-panel__tab--active' : ''}`}
- >
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth={1.5}>
- <path strokeLinecap="round" strokeLinejoin="round" d="M12 6v12m6-6H6" />
- <circle cx="12" cy="12" r="9" />
- </svg>
- <span>{t('nav.rails', 'Extensions')}</span>
- </button>
+ {visibleTabs.map((tab) => (
+ <button
+ type="button"
+ key={tab.key}
+ onClick={() => setActiveTab(tab.key)}
+ className={`extensions-hub-panel__tab ${activeTab === tab.key ? 'extensions-hub-panel__tab--active' : ''}`}
+ >
+ {tab.icon}
+ <span>{tab.label}</span>
+ </button>
+ ))}
</div>
</div>
diff --git a/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py b/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py
index d1d0e26bdf..2dac106295 100644
--- a/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py
+++ b/jiuwenclaw/gateway/channel_manager/tui/tui_connect.py
@@ -454,25 +454,6 @@ def _build_config_schema() -> list[dict]:
"options": ["zh", "en"], "source": "yaml", "default": "zh"},
{"key": "evolution_auto_scan", "label": "自动扫描技能", "group": "Features",
"type": "toggle", "source": "env", "default": "false"},
- # Auto-Harness (定时任务配置)
- {"key": "auto_harness_git_user_name", "label": "Git 用户名", "group": "Auto-Harness",
- "type": "string", "source": "yaml", "default": empty,
- "description": "用于定时任务执行时的 git commit"},
- {"key": "auto_harness_git_user_email", "label": "Git 邮箱", "group": "Auto-Harness",
- "type": "string", "source": "yaml", "default": empty,
- "description": "用于定时任务执行时的 git commit"},
- {"key": "auto_harness_git_fork_owner", "label": "Fork 仓库所有者", "group": "Auto-Harness",
- "type": "string", "source": "yaml", "default": empty,
- "description": "如 'auto-harness',用于创建 PR"},
- {"key": "auto_harness_git_remote", "label": "Git Remote 名称", "group": "Auto-Harness",
- "type": "string", "source": "yaml", "default": "autoharness",
- "description": "fork remote 名称,默认 'autoharness'"},
- {"key": "auto_harness_gitcode_access_token", "label": "GitCode Access Token", "group": "Auto-Harness",
- "type": "password", "sensitive": True, "source": "yaml", "default": empty,
- "description": "也可通过环境变量 GITCODE_ACCESS_TOKEN 配置"},
- {"key": "auto_harness_gitcode_username", "label": "GitCode 用户名", "group": "Auto-Harness",
- "type": "string", "source": "yaml", "default": empty,
- "description": "GitCode 登录用户名;为空时回退到 git.fork_owner"},
]
@@ -659,27 +640,6 @@ def register_cli_handlers(bind: CliHandlersBindParams) -> None:
payload.setdefault("memory_forbidden_enabled", "false")
payload.setdefault("preferred_language", "zh")
- # Auto-Harness config values (from ~/.jiuwenclaw/auto-harness/config.yaml)
- try:
- ah_config = _get_auto_harness_config()
- git_cfg = ah_config.get("git") or {}
- gitcode_cfg = ah_config.get("gitcode") or {}
- payload["auto_harness_git_user_name"] = git_cfg.get("user_name") or ""
- payload["auto_harness_git_user_email"] = git_cfg.get("user_email") or ""
- payload["auto_harness_git_fork_owner"] = git_cfg.get("fork_owner") or ""
- payload["auto_harness_git_remote"] = git_cfg.get("remote") or "autoharness"
- # Check env var first for access_token
- ah_token = os.getenv("GITCODE_ACCESS_TOKEN") or gitcode_cfg.get("access_token") or ""
- payload["auto_harness_gitcode_access_token"] = ah_token
- payload["auto_harness_gitcode_username"] = gitcode_cfg.get("username") or ""
- except Exception:
- payload.setdefault("auto_harness_git_user_name", "")
- payload.setdefault("auto_harness_git_user_email", "")
- payload.setdefault("auto_harness_git_fork_owner", "")
- payload.setdefault("auto_harness_git_remote", "autoharness")
- payload.setdefault("auto_harness_gitcode_access_token", "")
- payload.setdefault("auto_harness_gitcode_username", "")
-
payload["schema"] = _build_config_schema()
await channel.send_response(ws, req_id, ok=True, payload=payload)