feat: add bounded AgentsKit tool-calling example - #79
Open
EmersonBraun wants to merge 1 commit into
Open
Conversation
EmersonBraun
marked this pull request as ready for review
August 5, 2026 18:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
This adds a self-contained AgentsKit workspace to the TypeScript examples. It uses OpenRouter as the model gateway and a bounded AgentsKit runtime to investigate a synthetic checkout incident with two local tools.
The example preserves tool-call identity, limits execution to four model steps, returns structured tool results, and prints an inspectable run summary.
OPENROUTER_MODELselects the model without changing the tools, orchestration, or application contract.Why
Calling a model is only one part of an agent. The surrounding loop also needs predictable stopping behavior, tool-result correlation, and enough execution data to understand what happened.
This example keeps that control boundary small and provider-independent while still using OpenRouter's unified model gateway. The synthetic tools can later be replaced with metrics or deployment clients without rewriting the model integration.
Validation
bun --filter '@openrouter-examples/agentskit' typecheckbun --filter '@openrouter-examples/agentskit' test— 3 deterministic tests, 11 assertionsbunx biome check agentskitbun audit --audit-level=highgit diff --checkopenai/gpt-oss-20b:free: 3/4 steps, both local tools completed, tool-call IDs remained correlated, and all required answer sections were presentThe automated tests are credential-free and make no external requests. No key, raw provider payload or account data is included in the contribution.