Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 21 additions & 26 deletions crates/knolo-agent/src/runtime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading