Skip to content

The agent that grows with you

fix: dashboard, Desktop and managed SSH clients report a committed update's owed steps

Tekniuma9485fde6f58
diff --git a/apps/desktop/electron/managed-ssh-update.test.ts b/apps/desktop/electron/managed-ssh-update.test.ts
index 30d8a89c650..8196caf91fd 100644
--- a/apps/desktop/electron/managed-ssh-update.test.ts
+++ b/apps/desktop/electron/managed-ssh-update.test.ts
@@ -507,6 +507,69 @@ test.runIf(process.platform !== 'win32')(
}
)
+test.runIf(process.platform !== 'win32')(
+ 'a committed update that still owes a step stays a success but names the owed step',
+ async () => {
+ const home = await mkdtemp(path.join(os.tmpdir(), 'hermes-managed-owed-'))
+
+ const run = async (followups: unknown[]) => {
+ const receipts = path.join(home, 'logs', 'update_receipts')
+ await mkdir(receipts, { recursive: true })
+ await writeFile(path.join(home, `.update_exit_code.${CORRELATION}`), '0')
+ await writeFile(
+ path.join(receipts, 'update_x.json'),
+ JSON.stringify({
+ correlation_id: CORRELATION,
+ outcome: 'success',
+ started_at: '2026-08-23T00:00:00Z',
+ finished_at: '2026-08-23T00:01:00Z',
+ followups
+ })
+ )
+
+ const command = buildRemoteUpdateObservationCommand(
+ { ssh: { exec: async () => '' }, platform: 'Linux', hermesPath: '/opt/hermes/hermes', hermesHome: home },
+ CORRELATION
+ )
+
+ const observed = parseRemoteUpdateObservation((await exec(command, { shell: 'sh' })).stdout, CORRELATION)
+
+ return runManagedSshUpdate({
+ connectionId: 'home',
+ correlationId: CORRELATION,
+ scopes: [{ key: 'conn:home::default', profile: 'default' }],
+ preflightRemote: async () => {},
+ drainScope: async () => {},
+ updateRemote: async () => ({ exitCode: observed.exitCode!, receipt: observed.receipt! }),
+ awaitRestoreClearance: async () => {},
+ closeTransports: async () => {},
+ restoreScope: async () => {},
+ releaseGate: () => {}
+ })
+ }
+
+ try {
+ const owed = await run([{ step: 'dependencies', reason: 'sync failed', at: '2026-08-23T00:01:00Z' }])
+
+ assert.equal(owed.ok, true)
+ assert.equal(owed.updateOk, true)
+ assert.equal(owed.restoreOk, true)
+ assert.deepEqual(owed.owed, [{ step: 'dependencies', reason: 'sync failed' }])
+ assert.match(owed.message || '', /still owed: dependencies \(sync failed\)/)
+ assert.match(owed.message || '', /hermes update/)
+ assert.match(managedSshUpdateAllRow({ id: 'home' }, owed).detail || '', /dependencies/)
+
+ const clean = await run([])
+
+ assert.equal(clean.ok, true)
+ assert.equal(clean.owed, undefined)
+ assert.equal(clean.message, 'Remote Hermes updated and every managed SSH profile is ready.')
+ } finally {
+ await rm(home, { force: true, recursive: true })
+ }
+ }
+)
+
test.runIf(process.platform !== 'win32')(
'managed observer unwraps a named profile home for the install-wide marker',
async () => {
diff --git a/apps/desktop/electron/managed-ssh-update.ts b/apps/desktop/electron/managed-ssh-update.ts
index c9712f5165e..3e9b1bd07aa 100644
--- a/apps/desktop/electron/managed-ssh-update.ts
+++ b/apps/desktop/electron/managed-ssh-update.ts
@@ -29,6 +29,11 @@ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-
type ManagedUpdateOutcome = 'updated' | 'update-failed' | 'restore-failed' | 'update-and-restore-failed' | 'refused'
+interface ManagedUpdateOwedStep {
+ step: string
+ reason: string
+}
+
interface ManagedUpdateReceiptSummary {
correlationId: string
outcome: string
@@ -39,6 +44,9 @@ interface ManagedUpdateReceiptSummary {
preVersion?: string
postVersion?: string
stopReason?: string
+ // Post-commit steps a successful update still owes (contract C3).
+ followups?: ManagedUpdateOwedStep[]
+ userAction?: ManagedUpdateOwedStep | null
}
interface ManagedUpdateScopeResult {
@@ -57,6 +65,8 @@ interface ManagedConnectionUpdateResult {
exitCode: null | number
receipt: ManagedUpdateReceiptSummary | null
scopes: ManagedUpdateScopeResult[]
+ // Every step a committed update still owes; set only when non-empty.
+ owed?: ManagedUpdateOwedStep[]
error?: string
message?: string
// Set when the connection was deliberately not attempted (a known safety
@@ -427,12 +437,15 @@ def receipt():
if payload.get('outcome')=='running' or not payload.get('finished_at'):continue
pre=payload.get('pre_update') if isinstance(payload.get('pre_update'),dict) else {}
post=payload.get('post_update') if isinstance(payload.get('post_update'),dict) else {}
+ action=payload.get('user_action')
return {
'correlationId':correlation,'outcome':str(payload.get('outcome') or 'unknown'),
'startedAt':payload.get('started_at'),'finishedAt':payload.get('finished_at'),
'preSha':pre.get('sha'),'postSha':post.get('sha'),
'preVersion':pre.get('version'),'postVersion':post.get('version'),
'stopReason':payload.get('stop_reason'),
+ 'followups':[{'step':str(f.get('step')),'reason':str(f.get('reason') or '')} for f in payload.get('followups') or [] if isinstance(f,dict)],
+ 'userAction':{'step':str(action.get('step')),'reason':str(action.get('reason') or '')} if isinstance(action,dict) else None,
}
return None
@@ -481,6 +494,50 @@ function buildRemoteUpdateObservationCommand(target: RemoteUpdateTarget, correla
return `python3 -c ${shq(OBSERVATION_SCRIPT)} ${shq(home)} ${shq(correlation)}`
}
+function owedStep(value: any): ManagedUpdateOwedStep | null {
+ return value && typeof value === 'object' ? { step: String(value.step), reason: String(value.reason ?? '') } : null
+}
+
+// An older remote observer omits the debt fields: read them as none.
+function withReceiptDebt(receipt: any): ManagedUpdateReceiptSummary {
+ const followups = Array.isArray(receipt.followups) ? receipt.followups.map(owedStep).filter(Boolean) : []
+
+ return { ...receipt, followups, userAction: owedStep(receipt.userAction) }
+}
+
+// C3: a committed update is a success even when post-commit steps are owed;
+// name each one and its remedy instead of claiming everything is ready.
+function managedUpdateMessage(
+ outcome: ManagedUpdateOutcome,
+ restoreOk: boolean,
+ receipt: ManagedUpdateReceiptSummary | undefined
+): { owed?: ManagedUpdateOwedStep[]; message: string } {
+ if (outcome !== 'updated') {
+ return {
+ message: restoreOk
+ ? 'The remote update failed, but every managed SSH profile was restored.'
+ : 'The remote update transaction could not restore every managed SSH profile.'
+ }
+ }
+
+ const followups = receipt?.followups ?? []
+ const userAction = receipt?.userAction
+ const owed = [...followups, ...(userAction ? [userAction] : [])]
+
+ if (!owed.length) {
+ return { message: 'Remote Hermes updated and every managed SSH profile is ready.' }
+ }
+
+ const message =
+ 'Remote Hermes updated, but these steps are still owed: ' +
+ owed.map(step => (step.reason ? `${step.step} (${step.reason})` : step.step)).join('; ') +
+ '.' +
+ (followups.length ? ' Re-run `hermes update` on the remote to finish them.' : '') +
+ (userAction?.reason ? ` ${userAction.reason}` : '')
+
+ return { owed, message }
+}
+
function parseRemoteUpdateObservation(raw: string, correlationId: string): RemoteUpdateObservation {
const correlation = validateCorrelationId(correlationId)
let parsed: any
@@ -526,7 +583,7 @@ function parseRemoteUpdateObservation(raw: string, correlationId: string): Remot
throw new Error('Remote update receipt did not match this transaction.')
}
- receipt = parsed.receipt as ManagedUpdateReceiptSummary
+ receipt = withReceiptDebt(parsed.receipt)
}
let coordinatorReady: RemoteUpdateObservation['coordinatorReady'] = null
@@ -938,12 +995,7 @@ async function runManagedSshUpdate<TScope extends ManagedSshScope>(
receipt: proof?.receipt ?? null,
scopes: restoreResults,
...(error ? { error } : {}),
- message:
- outcome === 'updated'
- ? 'Remote Hermes updated and every managed SSH profile is ready.'
- : restoreOk
- ? 'The remote update failed, but every managed SSH profile was restored.'
- : 'The remote update transaction could not restore every managed SSH profile.'
+ ...managedUpdateMessage(outcome, restoreOk, proof?.receipt)
}
}
@@ -1180,6 +1232,7 @@ export {
managedSshUpdateAllRow,
type ManagedUpdateDeps,
type ManagedUpdateOutcome,
+ type ManagedUpdateOwedStep,
type ManagedUpdateReceiptSummary,
type ManagedUpdateScopeResult,
markerIsClear,
diff --git a/apps/desktop/src/global.d.ts b/apps/desktop/src/global.d.ts
index e0b63fe0346..0159edf0902 100644
--- a/apps/desktop/src/global.d.ts
+++ b/apps/desktop/src/global.d.ts
@@ -1232,6 +1232,8 @@ export interface DesktopManagedUpdateReceipt {
preVersion?: string
postVersion?: string
stopReason?: string
+ followups?: Array<{ step: string; reason: string }>
+ userAction?: { step: string; reason: string } | null
}
export interface DesktopManagedConnectionUpdateResult {
@@ -1244,6 +1246,8 @@ export interface DesktopManagedConnectionUpdateResult {
exitCode: number | null
receipt: DesktopManagedUpdateReceipt | null
scopes: Array<{ profile: string; restored: boolean; error?: string }>
+ /** Post-commit steps a successful update still owes (named in `message`). */
+ owed?: Array<{ step: string; reason: string }>
error?: string
message?: string
}
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index cec308d4b0c..f1d6cfead87 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -4232,10 +4232,10 @@ export const en: Translations = {
restarting: 'Backend restarting to load the update…',
notAvailable: 'Update not available for this backend.',
failed: 'Backend update failed.',
- noReturn: 'Backend didn’t come back online. The update may not have completed — check the backend host.'
+ noReturn: 'Backend didn’t come back online. The update may not have completed — check the backend host.',
+ owed: steps => `Backend updated, but still owed: ${steps}. Re-run \`hermes update\` to finish them.`
},
- // Update-status overlay + version-details (mechanism-aware update UI).
- appName: 'Hermes',
+ appName: 'Hermes', // Update-status overlay + version-details (mechanism-aware update UI).
version: (value: string) => `Version ${value}`,
versionUnavailable: 'Version unavailable',
checkNow: 'Check now',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 7645d14cd8f..9a88a48f8d2 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -3521,9 +3521,9 @@ export interface Translations {
notAvailable: string
failed: string
noReturn: string
+ owed: (steps: string) => string
}
- /** Update-status overlay + version-details (mechanism-aware update UI):
- * the overlay reads these off t.updates directly. */
+ /** Update-status overlay + version-details (mechanism-aware update UI), read off t.updates directly. */
appName: string
version: (value: string) => string
versionUnavailable: string
diff --git a/apps/desktop/src/store/updates.test.ts b/apps/desktop/src/store/updates.test.ts
index 173ff4c36a8..a0cb66cb637 100644
--- a/apps/desktop/src/store/updates.test.ts
+++ b/apps/desktop/src/store/updates.test.ts
@@ -1487,6 +1487,58 @@ describe('applyBackendUpdate recovery', () => {
expect(result.ok).toBe(false)
expect($backendUpdateApply.get().stage).toBe('error')
}, 10000)
+
+ it('reports a committed update with owed follow-ups as success plus an owed-step warning', async () => {
+ updateHermesSpy.mockResolvedValue({ action_id: 'e'.repeat(32), ok: true, name: 'hermes-update', pid: 1 })
+ getActionStatusSpy.mockResolvedValue({
+ exit_code: 0,
+ lines: ['Update complete!'],
+ name: 'hermes-update',
+ pid: null,
+ running: false,
+ receipt: { outcome: 'success', followups: [{ step: 'dependencies', reason: 'sync failed' }], user_action: null }
+ })
+ notifySpy.mockClear()
+
+ const promise = applyBackendUpdate()
+ await vi.advanceTimersByTimeAsync(1500)
+ const result = await promise
+
+ expect(result).toMatchObject({ ok: true })
+ expect(result.message).toContain('dependencies (sync failed)')
+ expect(notifySpy).toHaveBeenCalledWith(
+ expect.objectContaining({ kind: 'warning', message: expect.stringContaining('dependencies (sync failed)') })
+ )
+ })
+
+ it("never lets another action's receipt certify this update", async () => {
+ const receipt = (actionId: string) => ({
+ exit_code: null,
+ lines: [],
+ name: 'hermes-update',
+ pid: null,
+ running: false,
+ receipt: {
+ action_id: actionId,
+ outcome: 'success',
+ started_at: new Date().toISOString(),
+ finished_at: new Date().toISOString(),
+ followups: [],
+ user_action: null
+ }
+ })
+
+ updateHermesSpy.mockResolvedValue({ action_id: 'b'.repeat(32), ok: true, name: 'hermes-update', pid: 1 })
+ getActionStatusSpy.mockResolvedValue(receipt('a'.repeat(32)))
+ const foreign = applyBackendUpdate()
+ await vi.advanceTimersByTimeAsync(6 * 60 * 1000 + 1500)
+ await expect(foreign).resolves.toMatchObject({ ok: false })
+
+ getActionStatusSpy.mockResolvedValue(receipt('b'.repeat(32)))
+ const own = applyBackendUpdate()
+ await vi.advanceTimersByTimeAsync(1500)
+ await expect(own).resolves.toMatchObject({ ok: true })
+ })
})
describe('startUpdatePoller', () => {
diff --git a/apps/desktop/src/store/updates.ts b/apps/desktop/src/store/updates.ts
index bdcd35b8cb9..b78ecf5ffa7 100644
--- a/apps/desktop/src/store/updates.ts
+++ b/apps/desktop/src/store/updates.ts
@@ -22,7 +22,7 @@ import { $connectionsRegistry, refreshConnectionsRegistry } from '@/store/connec
import { reconnectGateway } from '@/store/gateway-reconnect'
import { dismissNotification, notify } from '@/store/notifications'
import { $connection } from '@/store/session'
-import type { BackendUpdateCheckResponse } from '@/types/hermes'
+import type { BackendUpdateCheckResponse, UpdateReceiptSummary } from '@/types/hermes'
/** Keyed per retired-channel revision: a new retirement (or a revision bump on
* the same channel) re-shows the notice, a plain re-check never does. */
@@ -747,7 +747,15 @@ const BACKEND_ACTION_POLL_MS = 1500
const BACKEND_ACTION_MAX_MS = 6 * 60 * 1000
const BACKEND_RETURN_MAX_MS = 4 * 60 * 1000
-function finishBackendApply(returned: boolean): DesktopUpdateApplyResult {
+// C3: a committed update succeeds even when post-commit steps are still owed.
+// Name every owed step (and its reason) instead of reporting plain success.
+function owedSteps(receipt: UpdateReceiptSummary | undefined): string {
+ return [...(receipt?.followups ?? []), ...(receipt?.user_action ? [receipt.user_action] : [])]
+ .map(step => (step.reason ? `${step.step} (${step.reason})` : step.step))
+ .join('; ')
+}
+
+function finishBackendApply(returned: boolean, receipt?: UpdateReceiptSummary): DesktopUpdateApplyResult {
if (returned) {
$backendUpdateApply.set(IDLE)
setUpdateOverlayOpen(false)
@@ -765,6 +773,14 @@ function finishBackendApply(returned: boolean): DesktopUpdateApplyResult {
// affordance in remote mode targets the backend, so nothing ever told
// them the app itself was stale). Nudge with a one-click client update.
void maybeNudgeClientAfterBackendUpdate()
+ const owed = owedSteps(receipt)
+
+ if (owed) {
+ const message = translateNow('updates.applyStatus.owed', owed)
+ notify({ durationMs: 0, kind: 'warning', message })
+
+ return { ok: true, message }
+ }
return { ok: true, message: 'Backend update applied.' }
}
@@ -813,7 +829,11 @@ function completedAfterRestart(
* run started at-or-after we kicked the update off counts — an older
* receipt describes a previous update, and a still-running one proves
* nothing yet. The 60s slack absorbs client/backend clock skew. */
-function receiptProvesOutcome(status: Awaited<ReturnType<typeof getActionStatus>>, applyStartedAtMs: number): boolean {
+function receiptProvesOutcome(
+ status: Awaited<ReturnType<typeof getActionStatus>>,
+ applyStartedAtMs: number,
+ actionId: string | undefined
+): boolean {
const receipt = status.receipt
if (!receipt || !receipt.finished_at || !receipt.started_at) {
@@ -824,6 +844,12 @@ function receiptProvesOutcome(status: Awaited<ReturnType<typeof getActionStatus>
return false
}
+ // A backend that records the writing action (null for a CLI run) proves
+ // identity directly: another action's success cannot certify this one.
+ if (actionId && receipt.action_id !== undefined) {
+ return receipt.action_id === actionId
+ }
+
const startedMs = Date.parse(receipt.started_at)
return Number.isFinite(startedMs) && startedMs >= applyStartedAtMs - 60_000
@@ -929,15 +955,15 @@ async function runBackendUpdate(): Promise<DesktopUpdateApplyResult> {
}
if (last.exit_code === 0 || (last.exit_code === null && completedAfterRestart(last, started.action_id))) {
- return finishBackendApply(true)
+ return finishBackendApply(true, last.receipt)
}
// #91277 bullet 3: the backend now attaches the durable update
// receipt to the status. A receipt whose run STARTED after we kicked
// this update off is authoritative — read its outcome instead of
// inferring from log markers or timing out across the restart gap.
- if (last.exit_code === null && receiptProvesOutcome(last, applyStartedAtMs)) {
- return finishBackendApply(last.receipt!.outcome === 'success')
+ if (last.exit_code === null && receiptProvesOutcome(last, applyStartedAtMs, started.action_id)) {
+ return finishBackendApply(last.receipt!.outcome === 'success', last.receipt)
}
if (!started.action_id && last.exit_code === null) {
diff --git a/apps/desktop/src/types/hermes.ts b/apps/desktop/src/types/hermes.ts
index 69b4cba8a97..81647d34e62 100644
--- a/apps/desktop/src/types/hermes.ts
+++ b/apps/desktop/src/types/hermes.ts
@@ -1557,6 +1557,11 @@ export interface UpdateReceiptSummary {
post_sha: string | null
post_version: string | null
fleet_states: string[]
+ /** Post-commit steps a committed (successful) update still owes. */
+ followups?: Array<{ step: string; reason: string }>
+ user_action?: { step: string; reason: string } | null
+ /** Dashboard action that wrote the receipt; null for a CLI-run update. */
+ action_id?: string | null
}
export interface ActionStatusResponse {
diff --git a/hermes_cli/web_routers/actions.py b/hermes_cli/web_routers/actions.py
index f6c0845f2ea..050ee2dfd1d 100644
--- a/hermes_cli/web_routers/actions.py
+++ b/hermes_cli/web_routers/actions.py
@@ -450,6 +450,11 @@ def _latest_update_receipt_summary(action_id: Optional[str] = None) -> Optional[
"pre_sha": (receipt.get("pre_update") or {}).get("sha"),
"post_sha": post.get("sha"), "post_version": post.get("version"),
"fleet_states": sorted({str(e.get("state")) for e in receipt.get("fleet") or [] if isinstance(e, dict)}),
+ # C3: a committed run is ``success`` even while post-commit steps are owed; carry them
+ # so a client reports the owed step and its remedy instead of plain success.
+ "followups": [{"step": str(f.get("step")), "reason": str(f.get("reason") or "")}
+ for f in receipt.get("followups") or [] if isinstance(f, dict)],
+ "user_action": receipt.get("user_action") if isinstance(receipt.get("user_action"), dict) else None,
}
except Exception:
return None
diff --git a/locales/_keys.desktop.json b/locales/_keys.desktop.json
index b0babc71d73..67e80ac0a43 100644
--- a/locales/_keys.desktop.json
+++ b/locales/_keys.desktop.json
@@ -4697,6 +4697,7 @@
"updates.applyStatus.failed",
"updates.applyStatus.noReturn",
"updates.applyStatus.notAvailable",
+ "updates.applyStatus.owed",
"updates.applyStatus.preparing",
"updates.applyStatus.pulling",
"updates.applyStatus.restarting",
diff --git a/tests/hermes_cli/test_web_server_update_status.py b/tests/hermes_cli/test_web_server_update_status.py
index 132e486291b..e42a65d4d8b 100644
--- a/tests/hermes_cli/test_web_server_update_status.py
+++ b/tests/hermes_cli/test_web_server_update_status.py
@@ -119,3 +119,35 @@ class TestUpdateStatusRootLog:
# The attached receipt names its writer: B's own when it exists, else A's (never B's).
assert data["receipt"]["action_id"] == (b_id if b_outcome else a_id)
assert data["receipt"]["outcome"] == (b_outcome or "success")
+
+ @pytest.mark.parametrize("debt", ["none", "followups", "user_action"])
+ def test_status_receipt_carries_owed_steps_of_a_committed_update(self, monkeypatch, tmp_path, debt):
+ # C3: owed post-commit steps keep the run a success (exit 0); the summary must still name
+ # them so the dashboard and Desktop report the debt instead of plain success.
+ from hermes_cli import update_receipt
+
+ root, action_id = tmp_path / "root", "c" * 32
+ monkeypatch.setenv("HERMES_HOME", str(root / "profiles" / "coder"))
+ monkeypatch.setenv("HERMES_ACTION_ID", action_id)
+ update_receipt.begin_update_receipt()
+ if debt == "followups":
+ update_receipt.record_followup("dependencies", "synthetic selected-interpreter sync failed")
+ update_receipt.record_followup("config_migration", "disk full")
+ elif debt == "user_action":
+ update_receipt.record_user_action("autostash", "re-apply the parked stash")
+ update_receipt.finalize_update_receipt("success")
+ (tmp_path / "hermes-update.log").write_text(
+ f"=== hermes-update started 2026-08-17 11:19:34 {action_id} ===\n", encoding="utf-8")
+ monkeypatch.setattr(_web_server_gateway, "_ACTION_LOG_DIR", tmp_path)
+ for registry in ("_ACTION_PROCS", "_ACTION_RESULTS", "_ACTION_COMMANDS", "_ACTION_IDS"):
+ monkeypatch.setattr(_web_server_gateway, registry, {})
+
+ data = self.client.get("/api/actions/hermes-update/status?lines=2000").json()
+
+ receipt = data["receipt"]
+ assert [f["step"] for f in receipt["followups"]] == (
+ ["dependencies", "config_migration"] if debt == "followups" else [])
+ assert receipt["user_action"] == (
+ {"step": "autostash", "reason": "re-apply the parked stash"} if debt == "user_action" else None)
+ # Debt never changes the C3 exit mapping: owed follow-ups stay exit 0, a user action is partial.
+ assert data["exit_code"] == (1 if debt == "user_action" else 0)
diff --git a/web/src/contexts/SystemActions.tsx b/web/src/contexts/SystemActions.tsx
index db92b365153..6f228299d52 100644
--- a/web/src/contexts/SystemActions.tsx
+++ b/web/src/contexts/SystemActions.tsx
@@ -9,6 +9,13 @@ import {
type SystemAction,
} from "./system-actions-context";
+// hermes-update status only: the receipt summary's owed post-commit steps (a committed update is
+// exit 0 even while they are owed).
+interface ReceiptDebt {
+ followups?: { step: string; reason: string }[];
+ user_action?: { step: string; reason: string } | null;
+}
+
const ACTION_NAMES: Record<SystemAction, string> = {
restart: "gateway-restart",
update: "hermes-update",
@@ -51,12 +58,20 @@ export function SystemActionsProvider({
? sharedGatewayProfiles(await api.getStatus().catch(() => null))
: null;
if (cancelled) return;
+ // C3: exit 0 with owed post-commit steps is still a success, but name what is owed.
+ const receipt = (resp as ActionStatusResponse & { receipt?: ReceiptDebt }).receipt;
+ const owed = [
+ ...(receipt?.followups ?? []),
+ ...(receipt?.user_action ? [receipt.user_action] : []),
+ ].map((step) => step.step);
setToast({
- type: ok ? "success" : "error",
+ type: ok && !owed.length ? "success" : "error",
message: ok
? shared
? sharedGatewayRestartedMessage(shared.length)
- : t.status.actionFinished
+ : owed.length
+ ? `${t.status.actionFinishedOwed}: ${owed.join(", ")}`
+ : t.status.actionFinished
: `${t.status.actionFailed} (exit ${resp.exit_code ?? "?"})`,
});
return;
@@ -71,7 +86,7 @@ export function SystemActionsProvider({
return () => {
cancelled = true;
};
- }, [activeAction, t.status.actionFinished, t.status.actionFailed]);
+ }, [activeAction, t.status.actionFinished, t.status.actionFinishedOwed, t.status.actionFailed]);
const runAction = useCallback(
async (action: SystemAction) => {
diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts
index 28684fc4592..edee56dc837 100644
--- a/web/src/i18n/en.ts
+++ b/web/src/i18n/en.ts
@@ -128,6 +128,7 @@ export const en: Translations = {
status: {
actionFailed: "Action failed",
actionFinished: "Finished",
+ actionFinishedOwed: "Updated, but still owed (re-run `hermes update` to finish)",
actions: "Actions",
agent: "Agent",
activeSessions: "Active Sessions",
diff --git a/web/src/i18n/types.ts b/web/src/i18n/types.ts
index 5fe85819883..289df1e0958 100644
--- a/web/src/i18n/types.ts
+++ b/web/src/i18n/types.ts
@@ -145,6 +145,7 @@ export interface Translations {
status: {
actionFailed: string;
actionFinished: string;
+ actionFinishedOwed: string;
actions: string;
agent: string;
connected: string;