diegosouzapw/OmniRoute · error · Error
payload.error?.message ?? `HTTP
Error message
payload.error?.message ?? `HTTP ${res.status}` What it means
Agent-bridge server action guard: postServerAction() POSTs an action (start/stop/restart/trust-cert/regenerate-cert, optionally with sudoPassword) to /api/tools/agent-bridge/server and on non-ok throws payload.error?.message or the 'HTTP <status>' sentinel. The privileged action did not take effect; the payload may also carry skippable/manualGuide fields describing certificate steps that must be done manually.
Solutions
- Read payload.error.message — it is the sanitized server-side reason (bad sudo password, process spawn failure)
- Follow manualGuide/skippable hints when present for cert actions
- Retry the action with corrected credentials or after fixing the service
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/app/(dashboard)/dashboard/tools/agent-bridge/AgentBridgePageClient.tsx:105 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/3e0523ede6f73a89.
Report an issue: GitHub.
Appendix: source
Thrown at src/app/(dashboard)/dashboard/tools/agent-bridge/AgentBridgePageClient.tsx:105
});
const postServerAction = useCallback(
async (
action: "start" | "stop" | "restart" | "trust-cert" | "regenerate-cert",
sudoPassword?: string
) => {
const res = await fetch("/api/tools/agent-bridge/server", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(sudoPassword ? { action, sudoPassword } : { action }),
});
const payload = (await res.json().catch(() => ({}))) as {
error?: { message?: string };
skippable?: boolean;
manualGuide?: CertManualGuide;
};
if (!res.ok) {
throw new Error(payload.error?.message ?? `HTTP ${res.status}`);
}
if (payload.skippable && payload.manualGuide) {
setCertGuide(payload.manualGuide);
} else if (action === "trust-cert") {
setCertGuide(null);
}
await refresh();
},
[refresh]
);
// ── Server actions ────────────────────────────────────────────────────────
const handleServerAction = useCallback(
async (action: "start" | "stop" | "restart" | "trust-cert" | "regenerate-cert") => {
setActionError(null);
if (action === "trust-cert") {
await runPrivileged(async (password) => {View on GitHub (pinned to a179ffed5b)