Skip to content

fix(hub): stop swallowing errors in agent runtime paths - #4

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-11845-stop-swallowing-errors-in-the-hubs-agent-runtime-paths
Oct 31, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-11845-stop-swallowing-errors-in-the-hubs-agent-runtime-paths

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Closes CL-11845 (https://linear.app/abklabs/issue/CL-11845/stop-swallowing-errors-in-the-hubs-agent-runtime-paths).

Changes

Error handling in the hub's live-app host, runner and proxy, sidecar spawn and provisioning, build package layout, coordinator startup, resume and upgrade, mail, artifacts and run stream:

  • Rewritten:
    • .catch(() => undefined) chains become async/await
    • IIFEs become named functions
    • empty and bare catches go away
  • Expected failures are checked for, or caught by type or code (ENOENT, SyntaxError, a refused fetch), and everything else is rethrown.
  • Best-effort cleanup logs the error with errorCode and requestErrorMetadata.
  • New helpers: lib/json.ts (readJson, parseJson, undefined only on a syntax error) and errorCode in request-error.ts, which logs a thrown error's code and never its message or paths.
  • Live-app host and proxy:
    • The host's stderr lines, which reach the app log the person sees, carry a fixed phrase and the error code, never a path or raw message.
    • The live-app proxy's server keeps answering 502 when a request fails.
    • mirrored.json is written atomically, and a corrupt one is mirrored again from scratch.
    • A failing file watch now degrades to a single sync, with a log line.

The rest of builds/, the interface and the hub's other areas are separate issues.

Verification

  • Lint, format and typecheck pass. Locally, 65 of 66 tests pass. The one failure is a 5-second timeout in packaged.test.ts, and it fails the same way on unchanged main under load.
  • Triage's local check passes all code-pattern rules on the change.
  • An independent review found five issues. All are fixed or out of scope by narrowing the issue: paths in the person-visible log, missing error codes, a raw 500 from the proxy, a changed status code, and the unconverted builds/ folder.
  • e2e runs in CI.

@linear-code

linear-code Bot commented Oct 31, 2026

Copy link
Copy Markdown

CL-11845

@corbits-triage

corbits-triage Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Triage: In progress

Triage is waiting for the decision model's answer before it decides. This comment shows the verdict once it has.

@TheGreatAxios
TheGreatAxios force-pushed the cl-11845-stop-swallowing-errors-in-the-hubs-agent-runtime-paths branch from a4443f4 to 5ccb2fb Compare October 31, 2026 08:39
@TheGreatAxios
TheGreatAxios merged commit 5ccb2fb into main Oct 31, 2026
7 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-11845-stop-swallowing-errors-in-the-hubs-agent-runtime-paths branch October 31, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant