diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cb002e..e9a51b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,8 +22,8 @@ jobs: strategy: { matrix: { task: [format-lint, unit, conformance, package] } } steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-node@1e60f620b9541dca151540becc8114408c7e2c4a - with: { node-version: 20, cache: pnpm } + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 + with: { node-version: 24 } - run: corepack enable && pnpm install --frozen-lockfile - run: | case '${{ matrix.task }}' in @@ -44,8 +44,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-node@1e60f620b9541dca151540becc8114408c7e2c4a - with: { node-version: 20 } + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 + with: { node-version: 24 } - run: ./scripts/hygiene.sh - run: node scripts/check-links.mjs - run: node scripts/check-packs.mjs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aa02fc5..277fa60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,8 +12,8 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - uses: dtolnay/rust-toolchain@stable - - uses: actions/setup-node@1e60f620b9541dca151540becc8114408c7e2c4a - with: { node-version: 20, registry-url: https://registry.npmjs.org } + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 + with: { node-version: 24, registry-url: https://registry.npmjs.org } - run: ./scripts/hygiene.sh - run: corepack enable && pnpm install --frozen-lockfile - run: cargo test --workspace && pnpm --filter @knolo/agents test diff --git a/crates/knolo-agent/src/runtime/mod.rs b/crates/knolo-agent/src/runtime/mod.rs index ba33183..0a87c42 100644 --- a/crates/knolo-agent/src/runtime/mod.rs +++ b/crates/knolo-agent/src/runtime/mod.rs @@ -211,37 +211,32 @@ impl<'a, E: NodeExecutor, S: EventSink, C: Clock, K: CheckpointStore> Scheduler< EventKindV1::NodeStarted { attempt }, &mut events, )?; - match self.executor.execute(NodeRequest { + let execution = self.executor.execute(NodeRequest { node_id: &node, state: &state, attempt, - }) { - Ok(x) => { - if let NodeOutcomeV1::Fail { - error, - retryable: true, - } = &x.outcome - { - if attempt <= self.policy.max_retries { - self.event( - &id, - Some(node.clone()), - &mut seq, - EventKindV1::Retrying { - attempt: attempt + 1, - }, - &mut events, - )?; - continue; - } - let error = error.clone(); - return self - .fail(id, node, state, events, seq, steps, tokens, cost, &error); - } - break x; + })?; + if let NodeOutcomeV1::Fail { + error, + retryable: true, + } = &execution.outcome + { + if attempt <= self.policy.max_retries { + self.event( + &id, + Some(node.clone()), + &mut seq, + EventKindV1::Retrying { + attempt: attempt + 1, + }, + &mut events, + )?; + continue; } - Err(e) => return Err(e), + let error = error.clone(); + return self.fail(id, node, state, events, seq, steps, tokens, cost, &error); } + break execution; }; steps += 1; tokens = tokens.saturating_add(execution.tokens);