Skip to content

Commit

Permalink
Ensure agents get a reference to state (#29)
Browse files Browse the repository at this point in the history
This allows tools to mutate state and have the state reflected in the
entire network
  • Loading branch information
tonyhb authored Dec 19, 2024
1 parent d40ca21 commit 327119e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
Empty file added examples/swebench/README.md
Empty file.
2 changes: 1 addition & 1 deletion src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class Agent {
const p = createAgenticModelFromAiAdapter(rawModel);

// input state always overrides the network state.
const s = state || network?.state?.clone() || new State();
const s = state || network?.state || new State();
const run = network && new NetworkRun(network, s);

let history = s ? s.format() : [];
Expand Down

0 comments on commit 327119e

Please sign in to comment.