Repository navigation
feat(gui): dashboard shows health, sync, sidecars and memory — settings go home #3387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f2232bd
ed7f6d4
8d7e132
eeabcab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /** | ||
| * Effort caps for the main model and for subagents (`/api/effort-caps`). | ||
| * | ||
| * This was a dashboard card. It only means something once multi-agent mode is on, and | ||
| * it is a delegation setting, so it lives with the other delegation settings on the | ||
| * Subagents page. The read goes through the shared client-resource layer; a save is an | ||
| * optimistic override until the server answers. | ||
| */ | ||
| import { useCallback, useState } from "react"; | ||
| import { useKeyedClientResource } from "../../client-resource"; | ||
| import { useT } from "../../i18n/shared"; | ||
| import { Select } from "../../ui"; | ||
| import { EFFORT_CAP_LEVELS, requireJson } from "../../pages/dashboard-shared"; | ||
|
|
||
| type Caps = { effortCap: string; subagentEffortCap: string }; | ||
|
|
||
| async function readCaps(apiBase: string, signal: AbortSignal): Promise<Caps> { | ||
| const res = await fetch(`${apiBase}/api/effort-caps`, { signal }); | ||
| const data = await requireJson<{ effortCap?: string | null; subagentEffortCap?: string | null }>(res); | ||
| return { effortCap: data.effortCap ?? "", subagentEffortCap: data.subagentEffortCap ?? "" }; | ||
| } | ||
|
|
||
| export function EffortCapSection({ apiBase }: { apiBase: string }) { | ||
| const t = useT(); | ||
| const read = useKeyedClientResource(`effort-caps:${apiBase}`, [apiBase], (signal) => readCaps(apiBase, signal)); | ||
| const [override, setOverride] = useState<Caps | null>(null); | ||
| const [saving, setSaving] = useState(false); | ||
| const caps: Caps = override ?? read.data ?? { effortCap: "", subagentEffortCap: "" }; | ||
|
|
||
| const save = useCallback(async (patch: { effortCap?: string | null; subagentEffortCap?: string | null }) => { | ||
| if (saving) return; | ||
| setSaving(true); | ||
| try { | ||
| const res = await fetch(`${apiBase}/api/effort-caps`, { | ||
| method: "PUT", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify(patch), | ||
| }); | ||
| const data = await requireJson<{ ok: boolean; effortCap?: string | null; subagentEffortCap?: string | null }>(res); | ||
| setOverride({ effortCap: data.effortCap ?? "", subagentEffortCap: data.subagentEffortCap ?? "" }); | ||
| } catch { /* ignore */ } | ||
| finally { setSaving(false); } | ||
| }, [apiBase, saving]); | ||
|
|
||
| const options = [ | ||
| { value: "", label: t("dash.effortCapNone") }, | ||
| ...EFFORT_CAP_LEVELS.map(e => ({ value: e, label: e })), | ||
| ]; | ||
|
|
||
| return ( | ||
| <section className="panel swi-effort-caps" aria-busy={read.data === undefined || undefined}> | ||
| <div className="setting-row"> | ||
| <div className="setting-label"> | ||
| <span className="title">{t("dash.effortCapLabel")}</span> | ||
| <span className="desc">{t("dash.effortCapHelp")}</span> | ||
| </div> | ||
| <div className="setting-controls" style={{ display: "flex", gap: 8 }}> | ||
| <Select | ||
| value={caps.effortCap} | ||
| options={options} | ||
| onChange={v => { void save({ effortCap: v || null }); }} | ||
| disabled={saving} | ||
| label={t("dash.effortCapLabel")} | ||
| align="right" | ||
| /> | ||
| <Select | ||
| value={caps.subagentEffortCap} | ||
| options={options} | ||
| onChange={v => { void save({ subagentEffortCap: v || null }); }} | ||
| disabled={saving} | ||
| label={t("dash.subagentEffortCapLabel")} | ||
| align="right" | ||
| /> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,9 +27,12 @@ import { modelLabel } from "../../model-display"; | |
| import { SectionTabs } from "../section-tabs"; | ||
| import { sectionAnchorId } from "../../section-anchors"; | ||
| import SubagentDelegationSection from "./SubagentDelegationSection"; | ||
| import { EffortCapSection } from "./EffortCapSection"; | ||
| import type { DelegationPatch, DelegationModelOption, UltraModePatch, UltraModeState } from "../../pages/use-subagent-delegation"; | ||
|
|
||
| export interface SubagentsWorkspaceProps { | ||
| /** Needed by sections that own their own fetch (effort caps). */ | ||
| apiBase?: string; | ||
| available: string[]; | ||
| chosen: string[]; | ||
| busy?: boolean; | ||
|
|
@@ -56,6 +59,7 @@ export interface SubagentsWorkspaceProps { | |
| export const FEATURED_MAX = 5; | ||
|
|
||
| export default function SubagentsWorkspace({ | ||
| apiBase, | ||
| available, | ||
| chosen, | ||
| busy = false, | ||
|
|
@@ -235,6 +239,13 @@ export default function SubagentsWorkspace({ | |
| ultraLoadFailed={delegation.ultraLoadFailed} | ||
| onUltraModeRetry={delegation.onUltraModeRetry} | ||
| /> | ||
| {/* | ||
| Effort caps only apply outside v1 (there are no ultra-mode turns to cap), which | ||
| is the same condition the dashboard used before this card moved here. | ||
| */} | ||
| {apiBase && delegation.ultraMode.multiAgentMode !== "v1" && ( | ||
| <EffortCapSection apiBase={apiBase} /> | ||
|
Comment on lines
+246
to
+247
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the Subagents workspace paints from session cache, or when AGENTS.md reference: gui/AGENTS.md:L9-L10 Useful? React with 👍 / 👎. |
||
| )} | ||
| </section> | ||
| </div> | ||
| </div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes
#dashboard/providersand#dashboard/modelsfrom persistent dashboard sections into redirects, but the English and translateddocs-site/**/guides/web-dashboard.mdpages still state that these hashes open dashboard sections and that the delegation picker and multi-agent summary remain on Dashboard. Users following the documented links now land on different pages and are directed to the wrong location for moved controls, so update the dashboard guide and its locales in the same change.AGENTS.md reference: gui/AGENTS.md:L36-L36
Useful? React with 👍 / 👎.