Skip to content

fix: harden runtime wait promotion semantics#423

Merged
haasonsaas merged 1 commit into
mainfrom
codex/local-agent-runtime-ledger
May 16, 2026
Merged

fix: harden runtime wait promotion semantics#423
haasonsaas merged 1 commit into
mainfrom
codex/local-agent-runtime-ledger

Conversation

@haasonsaas
Copy link
Copy Markdown
Contributor

Follow-up to #422 for review feedback that landed after the merge.

Changes:

  • narrow error-step promotion to failed tool-result entries only
  • keep failed model-call entries classified as model-call steps
  • preserve input vs approval wait types when pending request metadata exists
  • default metadata-poor wait entries to an approval wait so they remain represented in promotion plans
  • add focused regression tests for failed model calls and unknown waits

Mirrors evalops/maestro-internal#1974.

Verification:

  • bunx biome check --write --unsafe src/server/agent-runtime-ledger.ts test/cli/run-command.test.ts
  • node ./scripts/run-vitest.js --run test/cli/run-command.test.ts test/server/agent-trajectory-replay.test.ts test/server/agent-trajectory-validation.test.ts
  • bunx tsc -p tsconfig.build.json --noEmit
  • commit hook guardian/Biome/generated-contract/build checks

@cursor
Copy link
Copy Markdown

cursor Bot commented May 16, 2026

PR Summary

Medium Risk
Adjusts how runtime ledger entries are promoted into Platform run steps/waits, which can change downstream state/visibility for runs with failed events or sparse wait metadata. Changes are small and covered by targeted regression tests, but affect promotion semantics.

Overview
Refines AgentRuntime ledger promotion semantics to avoid over-promoting failures and to keep waits represented.

Error step classification is narrowed so only failed tool_result entries promote as AGENT_RUN_STEP_KIND_ERROR, while failed model_call entries remain AGENT_RUN_STEP_KIND_MODEL_CALL. Wait type derivation is hardened to preserve input vs approval when request metadata exists and to default unknown/metadata-poor waits to AGENT_RUN_WAIT_TYPE_APPROVAL so a wait_run promotion operation is still emitted.

Adds focused CLI regression tests covering the approval fallback for unknown waits and the revised failure classification for tool results vs model calls.

Reviewed by Cursor Bugbot for commit 943daa8. Bugbot is set up for automated code reviews on this repo. Configure here.

@haasonsaas haasonsaas force-pushed the codex/local-agent-runtime-ledger branch from fd80ebc to 943daa8 Compare May 16, 2026 06:21
@haasonsaas haasonsaas merged commit 39c0c81 into main May 16, 2026
11 checks passed
@haasonsaas haasonsaas deleted the codex/local-agent-runtime-ledger branch May 16, 2026 06:27
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