Studio: use Harper's built-in agent, with sessions, approvals and settings
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Start with src/integrations/api/chat/getChatTransport.ts to see how Studio sends commands, then read src/hooks/useRollingConfigUpdate.tsx for the existing settings save and restart flow. The issue names Harper’s agent operations and session behavior, but does not identify the instance page or session UI entry points. Done means admins can manage sessions, approvals, and settings for one instance, with the stated version, permission, restart, and error behavior.
索引モデルが issue の本文から書いたものです。
説明
Problem
Harper has a built-in AI agent that runs inside Harper. It takes a request in plain language, then works on the instance itself: reading data, logs and app files, and running Harper's admin commands. Fabric turns it on for Harper 5.2+. Studio has no screen for it, so a customer can only use it by typing raw commands into the Operations console. Studio's own chat assistant is separate: it runs through central-manager with its own AI model and doesn't use this agent (getChatTransport.ts).
What core already provides (harper, as of 5.3.4)
- Six admin-only commands:
agent_promptsends a request. Without asession_idit starts a new session; with one, it continues that session. It answers at once with the session id andrunning, and the agent keeps working in the background.get_agent_sessionreturns a session: its status, the full conversation and any actions waiting for approval.list_agent_sessionslists sessions.cancel_agent_runstops a session.approve_agent_actionapproves or denies one waiting action, then the agent carries on.set_agent_configchanges some of the agent's settings, but only until Harper restarts.
- Session statuses:
idle,running,awaiting_approval,completed,abortedanderror. A new prompt is refused while a session isrunningorawaiting_approval. - Restarts: sessions and waiting approvals are kept across restarts. Nothing in Harper picks up a run that a restart cut off.
- What the agent can use:
- Harper's admin commands, from the same list as the MCP server's operations part, filtered by
mcp.operations.allowanddeny. By default that's the read-only set. - Its own tools: read and write app files, read logs and settings files, fetch web addresses, attach a debugger to Harper's threads, and schedule a follow-up.
- Harper's admin commands, from the same list as the MCP server's operations part, filtered by
- Approvals: with
allowDestructiveoff, the tools that change things are removed (writing app files and running code in the debugger, plus any change command), so the agent never asks for approval. WithallowDestructiveon andautoApproveoff, each of those actions waits for a person to approve it. - Settings (
agentblock):enabled,provider,model,maxTurns,autoApprove,allowDestructive,user,systemPromptAppend,componentsScopeandmaxCostUsd. They're saved withset_configurationand take effect after a restart.- When the agent is off at startup, its commands don't exist, so only a settings change and a restart can turn it on.
maxCostUsdis accepted, but Harper doesn't enforce it.maxTurnsis the only limit that applies.
- Who the agent acts as:
agent.user, by defaulthdb_agent. That user's role limits the admin commands the agent runs. - Sessions stay on one node. They're stored on the node that ran them and aren't shared across a cluster, and a running session lives on that node.
- Source (v5.3.4): agent/, operations.ts, agent.ts, toolset.ts, session.ts, epic harper-pro#676.
On Fabric today
- Host-manager turns the agent on for Harper 5.2+, with
autoApproveandallowDestructiveoff andmaxTurns12 (agentConfig.js).- These are defaults, so a customer's own settings win.
- They reach an existing instance only when Fabric next rebuilds it, so older instances may still have the agent off.
- A host can be set to force the agent off. Then a customer's settings can't turn it back on.
- The agent has an AI model to call only on hosts that run one, which today means GPU hosts set up for it. Elsewhere the agent is on but has no model. That's covered by CM#457, CM#458 and HM#201, not this issue.
What to build
- An "Agent" page for each instance, shown only on Harper 5.2+ and only to admin users.
- Send every agent command to one specific instance (
/HDBInstance/:id/operation), not to the cluster, since sessions live on one node. On a cluster, say which node each session is on. - Sessions:
- Start a session with a request, and continue it with follow-ups.
- Show the conversation as it grows, including the actions the agent took, by checking
get_agent_sessionuntil the session stops running. - List past sessions with their status, and open one.
- Stop a running session.
- Don't offer a new prompt while a session is running or waiting for approval. When a session shows as running but isn't moving, for example after a restart, offer to stop it so it can continue.
- Approvals: when a session is waiting, show each waiting action with its command and inputs. Let the customer approve or deny it.
- Settings:
- Turn the agent on or off. Set
allowDestructive,autoApprove,maxTurns,user(pick a database user) andsystemPromptAppend. - Save with Studio's existing settings save and restart (useRollingConfigUpdate.tsx), not with
set_agent_config, which is lost on restart. Before saving, say that the instances restart, and warn when a session is running. - Don't offer
maxCostUsdwhile Harper doesn't enforce it. - When the agent is off on the instance, say so, and offer to turn it on.
- Turn the agent on or off. Set
- Explain, on the page:
- the agent acts on the instance itself
- choose a user for the agent: its role limits the admin commands the agent runs
- turning on
allowDestructivelets it change things, and turning onautoApprovelets it do so without asking - the commands it can run come from the same list as the MCP server (studio#2011)
- Show Harper's own error when a command is refused or a session ends in error, for example when the host has no AI model.
Acceptance criteria
- A customer can send the agent a request from Studio and follow the session until it finishes, without the Operations console.
- A customer can approve or deny a waiting action, and the session carries on.
- A customer can stop a running session.
- Settings saved in Studio still apply after a restart.
- Non-admin users don't see the page. On Harper below 5.2, the page is hidden or explains that it needs 5.2.
Dependencies
- No central-manager or host-manager work is needed for this page. Studio already sends admin commands to a single instance through Fabric's command channel, and that requires "update" permission on the cluster in Fabric.
- The agent only gets answers on hosts with an AI model until CM#457 and CM#458 land.
- 主要言語
- TypeScript
- スター
- 5
- フォーク
- 4
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 144
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HarperFast/studio のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
HarperFast/studio#2070 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
HarperFast/studio#2067 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
HarperFast/studio#2053 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
HarperFast/studio#2026 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
HarperFast/studio#2021 ·
メンテナーはふだん 2 日以内に返信
HarperFast/studio の issue をすべて見る
似ている issue
-
area: build-and-ci S3: minor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
manaflow-ai/cmux#39902 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
refined-github/refined-github#10387 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
CopilotKit/CopilotKit#8283 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
complexity:simple priority:P3 ready-to-build
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
junruxiong/IncarnaMind#2919 ·