Skip to content

fix(examples): make the framework examples run end to end - #405

Merged
glebedel merged 4 commits into
mainfrom
s2d2/audit-examples-run-fixes
Nov 13, 2026
Merged

glebedel merged 4 commits into
mainfrom
s2d2/audit-examples-run-fixes

Conversation

@glebedel

@glebedel glebedel commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

All seven examples were run against a local StackOne MCP stand-in with real OpenAI and Claude models. Four failed or printed the wrong thing on main at 9f948a8, and this PR fixes the examples and the README snippets that copy them. Since then #408 made toOpenAIResponses() non-strict by default, so on current main the OpenAI Responses example no longer fails and the explicit { strict: false } here is redundant. No library code changes here. The Claude Agent SDK tools also need the SDK fix in #406 to receive their arguments.

Example On main Fix
openai-responses-integration.ts Exits 1. OpenAI returns 400 Invalid schema for function 'bamboohr_list_employees': In context=('properties', 'query'), 'additionalProperties' is required to be supplied and to be false. toOpenAIResponses({ strict: false }), as the method's doc already advises for StackOne actions. Also in the README
ai-sdk-integration.ts Prints Arguments: undefined AI SDK 5+ tool calls carry input, not args
anthropic-integration.ts Uses claude-haiku-4-5-20241022, which is not a model id (20241022 is the Claude 3.5 Haiku date) claude-haiku-4-5-20251001, the Claude Haiku 4.5 id in Anthropic's docs and the installed @anthropic-ai/sdk Model type. Also in the README
claude-agent-sdk-integration.ts Claude answers "I need permission to access BambooHR to list employees", and no tools/call is made: a headless query cannot answer a permission prompt allowedTools: ['mcp__stackone-tools']. Because that runs every tool on the server without asking, the example and README now fetch only *_list_* actions

Dogfood: every example, main vs this branch

The stand-in is a local HTTP server built from mocks/mcp-server.ts that serves BambooHR and Workday tools with five fake workers and logs every request. OpenAI calls go to the real API (gpt-5.1). Claude calls go to real Claude through an Anthropic-compatible endpoint.

Example main This branch + #406
auth-management exit 0 exit 0, same output
search-and-execute exit 0, 3 tools/call exit 0, same requests
openai-integration exit 0, 1 tools/call exit 0, same requests
openai-responses-integration exit 1, 400 invalid schema exit 0, Tool calls found: 2
ai-sdk-integration exit 0, Arguments: undefined exit 0, Arguments: {"query":{"limit":5}}
anthropic-integration exit 0 (the endpoint maps unknown ids loosely; Anthropic's own API has no such id) exit 0, tool_use with {"query":{"limit":5}}
claude-agent-sdk-integration exit 0, asks for permission, 0 tools/call exit 0, tools/call bamboohr_list_employees {"query":{"limit":5}} -> 200, lists the five workers

Claude Agent SDK, this branch with #406:

  Tool use: mcp__stackone-tools__bamboohr_list_employees
  Input: {"query":{"limit":5}}
[stackone] POST /mcp account=your-bamboohr-account-id tools/list -> 200
[stackone] POST /mcp account=your-bamboohr-account-id tools/call bamboohr_list_employees {"query":{"limit":5}} -> 200
  Assistant: Here are the first 5 employees:
1. **Ada Lovelace** (ID: w1)
...
5. **Linus Torvalds** (ID: w5)

The four open audit PRs (#401 to #404) were also run together on one local branch with all seven examples. Each example made the same request sequence as on main, and auth-management and search-and-execute printed identical output, so none of those PRs changes example behaviour.

Test plan

  • pnpm vitest run tests/examples: 10 passed, no type errors
  • oxfmt --check README.md examples: pass
  • All seven examples run end to end as above

Gates

Gate Result Head
Repo skills None in repo (Nix-managed, gitignored). Read .claude/rules/*. release-please not applied: no release in scope 3f0af15
/forge:forge No library code. Example edits are one line each; the only comments added state why allowedTools and the *_list_* filter are there 3f0af15
Security scan (security-reviewer agent + Aikido) One Low finding, fixed in 3f0af15: the auto-approved example fetched every action, so it now fetches only *_list_* actions, with a comment in the README. Aikido: none of the open critical/high issues is in a changed file 1908b53, fix in 3f0af15
Codex security pass No findings 3f0af15
/security-review Pass (allowedTools covers only the StackOne server, built-in tools stay off with tools: []; no secrets in snippets) 3f0af15
/code-review One finding, fixed in 3f0af15: the README Anthropic snippet still had the old Haiku id 1908b53, fix in 3f0af15
Dogfood Above, every example, main vs this branch 3f0af15
CI Green (24 pass, 6 skipped by design) 3f0af15
Review threads 0 unresolved (Aikido: allow-list rule, answered with the run evidence: mcp__stackone-tools covers every tool on the server) 3f0af15

Post-merge validation

Docs and examples only, nothing to deploy. After the next release, run the OpenAI Responses and Claude Agent SDK examples against a real account. The signal that it works is tool calls with arguments and exit 0. The regression signal is a 400 schema error or a permission request.

Requested by guillaume@stackone.com in Slack (repo audit thread).

🤖 Generated with Claude Code

s2d2-s1 and others added 2 commits November 11, 2026 01:30
Running every example against a local StackOne MCP stand-in, with real
OpenAI and Claude models, showed four examples that fail or print the
wrong thing on main:

- openai-responses-integration: OpenAI rejects the strict schema (400
  "additionalProperties is required" for nested query objects), so the
  example and README now pass { strict: false }, as the toOpenAIResponses
  doc already advises for StackOne actions.
- ai-sdk-integration: AI SDK 5+ tool calls carry `input`, not `args`, so
  the example printed "Arguments: undefined".
- anthropic-integration: claude-haiku-4-5-20241022 is not a model id;
  the Claude Haiku 4.5 id is claude-haiku-4-5-20251001.
- claude-agent-sdk-integration: a headless query cannot answer a
  permission prompt, so the StackOne MCP tools are now listed in
  allowedTools and actually run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
…st actions

allowedTools runs every tool on the StackOne server without a prompt, so
the example and README now fetch only the list actions the prompt needs
rather than every action, writes included. The README Anthropic snippet
also gets the Claude Haiku 4.5 id the example already uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
@glebedel
glebedel requested a review from a team as a code owner November 11, 2026 01:37
@glebedel glebedel self-assigned this Nov 11, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T01:39:08.880447Z 3f0af15 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@405

commit: 63112c4

@glebedel
glebedel requested a review from StuBehan November 11, 2026 14:07
s2d2-s1 and others added 2 commits November 12, 2026 03:12
… to non-strict

#408 made toOpenAIResponses non-strict by default, so passing it and
explaining that strict mode rejects optional fields is redundant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Guillaume Lebedel <10488548+glebedel@users.noreply.github.com>
@glebedel

Copy link
Copy Markdown
Contributor Author

s2d2 fix pass (requested by guillaume@stackone.com in Slack): merged main (4 commits behind, clean). Since #408 made toOpenAIResponses non-strict by default, removed the now redundant { strict: false } and its comment from the README and the OpenAI responses example. Examples typecheck passes locally. Repo skills: none in clone (rules read: git-workflow, development-workflow, typescript-patterns).

@glebedel
glebedel merged commit 3e7b2cc into main Nov 13, 2026
30 checks passed
@glebedel
glebedel deleted the s2d2/audit-examples-run-fixes branch November 13, 2026 02:18
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.

2 participants