Skip to content

Harden agent execution, recovery, and provider compatibility - #7

Merged
shiftynick merged 4 commits into
mainfrom
agent/runtime-hardening
Sep 26, 2026
Merged

shiftynick merged 4 commits into
mainfrom
agent/runtime-hardening

Conversation

@shiftynick

@shiftynick shiftynick commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Agent supervisors could crash on an early provider exit, leave descendants running after cancellation, and lose recovery metadata when a run failed. This change fixes those cases and keeps results usable across provider and package upgrades.

  • Handle stdin errors, forward CLI stop signals, and finish process-tree cleanup after the provider leader exits.
  • Preserve session/model metadata and provider diagnostics on incomplete runs; normalize Claude schema output and generate unique Claude worktree names.
  • Support Codex native forks and persistent isolated worktrees, reject unsupported forks, and use the request environment for bounded rollout attribution.
  • Bound stdout/stderr retention with configurable limits, stop explicitly on overflow, and reuse incrementally decoded events.
  • Probe installed CLI help for optional capabilities and add cached, opt-out package update notices with structured results.
  • Add Linux/Windows Node 20/22/24 CI, native process regression tests, versioned protocol fixtures, and documentation.

Validation: TypeScript, 134 unit tests, 18 Node package/process tests, npm package dry run, production dependency audit, and diff whitespace checks passed locally. Authenticated live provider calls remain opt-in. All six CI jobs passed on Linux and Windows with Node 20, 22, and 24. Windows also executes the environment-casing and .cmd regressions; POSIX-only signal tests are skipped there.

Compatibility notes: stdout/stderr limits now default to 16 MiB/1 MiB; overflow produces a failed partial result. CLI update checks can be disabled with AGENT_HEADLESS_NO_UPDATE_CHECK=1; library checks are opt-in. Codex isolated runs require persistence so checkout metadata can be recovered. This PR does not publish an npm release.

@shiftynick
shiftynick merged commit 9fc5fb4 into main Sep 26, 2026
6 checks passed
@shiftynick
shiftynick deleted the agent/runtime-hardening branch September 26, 2026 14:25
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