Skip to content

fix(agent-testing): add OIDC mock routes and warn on unhandled URLs in sandbox#1486

Merged
Scra3 merged 1 commit intomainfrom
fix/agent-testing-sandbox-oidc-mock
Mar 3, 2026
Merged

fix(agent-testing): add OIDC mock routes and warn on unhandled URLs in sandbox#1486
Scra3 merged 1 commit intomainfrom
fix/agent-testing-sandbox-oidc-mock

Conversation

@Scra3
Copy link
Member

@Scra3 Scra3 commented Mar 3, 2026

Summary

  • Add OIDC mock endpoints (/oidc/.well-known/openid-configuration and /oidc/reg) to ForestServerSandbox so AuthService.init() no longer 404s when starting a real agent against the mock
  • Add console.warn on unhandled URLs in the sandbox default case to help debug 404 issues
  • Add integration test sandbox-with-real-agent.test.ts validating the full recommended setup: createForestServerSandbox → real createAgentcreateAgentTestClient

Context

A customer reported errors when using createForestServerSandbox + createAgentTestClient with a real Node.js agent. The sandbox was missing OIDC endpoints, causing auth init warnings. The warn log on unhandled URLs will help identify what endpoint actually causes 404s in their environment.

Test plan

  • Integration test with real agent passes on Node 18 and Node 22
  • All existing tests still pass (16/16)
  • Lint clean

🤖 Generated with Claude Code

…n sandbox

The ForestServerSandbox was missing OIDC endpoints, causing auth warnings
when starting a real agent against the mock server. Also add a console.warn
for unhandled URLs to help debug 404 issues.

Includes an integration test validating the full recommended setup:
createForestServerSandbox + real createAgent + createAgentTestClient.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Scra3 Scra3 force-pushed the fix/agent-testing-sandbox-oidc-mock branch from 6ccb24c to 8098d31 Compare March 3, 2026 09:45
@qltysh
Copy link

qltysh bot commented Mar 3, 2026

Qlty

Coverage Impact

⬆️ Merging this pull request will increase total coverage on main by 0.48%.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: F Coverage rating: C
packages/agent-testing/src/forest-server-sandbox.ts71.4%153-154
Total71.4%
🤖 Increase coverage with AI coding...

In the `fix/agent-testing-sandbox-oidc-mock` branch, add test coverage for this new code:

- `packages/agent-testing/src/forest-server-sandbox.ts` -- Line 153-154

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@Scra3 Scra3 merged commit a8088e8 into main Mar 3, 2026
28 checks passed
@Scra3 Scra3 deleted the fix/agent-testing-sandbox-oidc-mock branch March 3, 2026 09:51
forest-bot added a commit that referenced this pull request Mar 3, 2026
## @forestadmin/agent-testing [1.0.20](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent-testing@1.0.19...@forestadmin/agent-testing@1.0.20) (2026-03-03)

### Bug Fixes

* **agent-testing:** add OIDC mock routes and warn on unhandled URLs in sandbox ([#1486](#1486)) ([a8088e8](a8088e8))
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