feat(dashboard/hands): enlarge TOML view, edit agent system prompt and tools with reset-to-default (#6150 #6151 #6152)#6166
Merged
Merged
Conversation
houko
force-pushed
the
feat/hands-editing-ui
branch
from
June 17, 2026 12:27
6fd0660 to
d396b8d
Compare
houko
enabled auto-merge (squash)
June 17, 2026 12:27
houko
marked this pull request as draft
June 17, 2026 12:32
auto-merge was automatically disabled
June 17, 2026 12:32
Pull request was converted to draft
houko
marked this pull request as ready for review
June 17, 2026 12:37
houko
enabled auto-merge (squash)
June 17, 2026 12:40
…d tools with reset-to-default (#6150 #6151 #6152) Enlarge the HAND.toml viewer from a 3xl/65vh pane to a near-fullscreen 7xl/78vh scrollable shell so dense manifests are readable (#6150). Add a per-agent "Agent" tab on the hand detail panel that edits each role's system prompt (#6151) and tool allowlist (#6152), each with a one-click "restore default" control. The editor seeds from the live agent config (system prompt via GET /api/agents/{id}, tools via GET /api/agents/{id}/tools) and saves through the existing PATCH /api/agents/{id} and PUT /api/agents/{id}/tools endpoints; the manifest baseline carried on GET /api/hands/{id} is the reset target. Editing is gated on the hand being active, since a live agent_id only exists for an active instance — mirroring the existing settings editor. Expose the parsed HAND.toml system_prompt and capabilities.tools per agent on GET /api/hands/{id} so the dashboard has an honest reset-to-default baseline that the per-agent edit endpoints never overwrite (they target the live AgentRegistry / agent.toml, not HAND.toml). i18n keys added to en/zh/uk. No new backend write endpoint was needed; the existing per-agent config endpoints already cover system prompt and tools.
houko
force-pushed
the
feat/hands-editing-ui
branch
from
June 17, 2026 14:22
d396b8d to
e04c129
Compare
Deploying librefang with
|
| Latest commit: |
e04c129
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6a54b9b0.librefang-7oe.pages.dev |
| Branch Preview URL: | https://feat-hands-editing-ui.librefang-7oe.pages.dev |
Deploying librefang-docs with
|
| Latest commit: |
e04c129
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5170695e.librefang-docs.pages.dev |
| Branch Preview URL: | https://feat-hands-editing-ui.librefang-docs.pages.dev |
This was referenced Jun 17, 2026
houko
added a commit
that referenced
this pull request
Jun 19, 2026
…er (#6201) * feat(dashboard): edit + bind system prompt from the agent detail drawer The Agents page showed the system prompt read-only, and the Prompts modal's activate only flipped the store is_active flag without changing the live prompt the agent sends to the LLM. The Hands page already had a full inline editor (#6151 / #6166), so the two pages were inconsistent. Convert SystemPromptSection into an inline editor mirroring the Hands page: edit and save via PATCH /api/agents/{id}, or open the prompt library and bind a saved version via useBindPromptVersionToAgent, which hot-swaps the live system_prompt and flips is_active together. The section now always renders so an agent with no prompt yet can have one added. Dashboard-only; the backend update_system_prompt path is unchanged. i18n added to en/zh/uk; the editor is covered by a new AgentsPage.test.tsx (save PATCHes system_prompt; bind dispatches the version). Closes #6187 * style(dashboard): collapse multi-line comment blocks to one-liners per CLAUDE.md --------- Co-authored-by: Evan <[email protected]> Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three Hands-page UX improvements, one PR.
#6150 — Enlarge the HAND.toml view
The manifest viewer (
TomlViewer) was capped at a3xlmodal with a65vhcode pane, which is cramped for a dense manifest.It now opens at
7xlwith a78vhscrollable body — near-fullscreen while still letting the centred modal manage its own90vhcap.Responsive and dark-mode behaviour is unchanged (same
Modalshell, same theme tokens).#6151 — Edit a hand agent's system prompt (with restore-default)
A new "Agent" tab on the hand detail panel lets you edit each role's system prompt in a textarea and save it.
A one-click "Restore default" (一键恢复默认) control resets the draft to the value shipped in the hand's
HAND.toml.#6152 — Edit a hand agent's tools (with restore-default)
The same tab edits the agent's tool allowlist (
capabilities.tools): add a tool by name, remove an existing chip, then save."Restore default" resets the list to the
HAND.tomlbaseline.How it works
The editor seeds from the live agent config and writes through endpoints that already exist:
GET /api/agents/{id}(system_prompt), saved viaPATCH /api/agents/{id}(usePatchAgent).GET /api/agents/{id}/tools(capabilities_tools), saved viaPUT /api/agents/{id}/tools(useUpdateAgentTools).HAND.tomlvalues, newly exposed per-agent onGET /api/hands/{id}.Editing is gated on the hand being active, because a live
agent_idonly exists for an active instance — the inactive state shows a "activate first" hint, mirroring the existing settings editor.The manifest baseline on
GET /api/hands/{id}is an honest reset target: the per-agent edit endpoints write the liveAgentRegistry/agent.toml, neverHAND.toml, so the default is never destroyed.Backend change
One read-only addition:
get_hand(crates/librefang-api/src/routes/skills/hands.rs) now emitssystem_promptandcapabilities_toolsfor each entry in theagentsarray, straight from the parsed manifest.No new write endpoint was needed — the existing per-agent config endpoints already cover system prompt and tools.
Data-layer compliance
src/lib/queries/andsrc/lib/mutations/(useAgentDetail,useAgentTools,usePatchAgent,useUpdateAgentTools); no inlinefetch/api.*in the page.agentKeysfactories; no inline key arrays.agentKeys.detail/agentKeys.tools).en.json,zh.json,uk.json); no hardcoded user-visible strings.lucide-reacticons,motion/reacttab transitions (reused from the existing tab system), TypeScript strict (noany).Verification
Dashboard (
crates/librefang-api/dashboard):pnpm install --frozen-lockfile— clean.pnpm typecheck— green.pnpm lint— 0 errors (only pre-existing baseline warnings; none fromHandsPage.tsxsource I added).pnpm test --run— 80 files, 794 tests passed.pnpm build— succeeds.Rust (via the sanctioned
Dockerfile.rust-devimage, per-worktree target volume — no hosttarget/contention):cargo check --workspace --lib— clean.cargo clippy -p librefang-api --all-targets -- -D warnings— clean.cargo test -p librefang-api --test hands_routes_integration— 29 passed, including the newget_hand_agents_expose_system_prompt_and_tools.cargo fmt -- --checkon the changed Rust files — clean.Maintainer notes
PATCH /api/agents/{id},PUT /api/agents/{id}/tools), which persist to the agent'sagent.toml+ DB. This is the same surface the Agents page already uses on hand-role agents. It does not rewriteHAND.toml; the manifest stays the source of "default", which is exactly what makes restore-default honest. I deliberately did not add aHAND.toml-rewriting endpoint (it would need format-preserving manifest surgery and a manifest-override merge layer inlibrefang-hands/librefang-kernel) — out of scope and unnecessary for the requested behaviour.PATCH/DELETE /api/agents/{id}/hand-runtime-config→HandAgentRuntimeOverride, persisted tohand_state.json, reset-on-DELETE) that currently covers model/provider/tokens/temperature/web-search but not system prompt or tools. Extending it to carry those two fields would let restore-default route through a single DELETE and keep the override inhand_state.jsoninstead ofagent.toml. That is a cross-crate change (librefang-handsstruct + merge,librefang-kernelapply, the route); happy to do it as a follow-up if you'd prefer that surface over the standalone agent-config endpoints used here.Closes #6150
Closes #6151
Closes #6152