Fix PR review comments: docs and test improvements

Merged
CH
8mo ago
+64-58
  1. OpenAPI YAML: Change description from >- to | literal scalar to preserve markdown table formatting. The folded scalar was collapsing table rows into a single line.

  2. api-multiregion.test.ts: Remove misleading STAGEHAND_API_URL env var scaffolding. The beforeEach/afterEach were dead code since no tests actually set the env var, and getApiUrlForRegion doesn't read it. Renamed the describe block to "URL /v1 suffix handling" to accurately reflect what the tests verify.

  3. multiRegion.test.ts: Add try/finally blocks around assertions to ensure endSession is always called even if assertions throw. This prevents session leaks that could cause flaky tests.


Summary by cubic

Fixes OpenAPI docs rendering and strengthens multi‑region tests to prevent session leaks and clarify URL behavior.

  • Bug Fixes

    • Preserve markdown table formatting by switching OpenAPI description to a literal scalar (|).
    • Always call endSession via try/finally in integration tests to prevent leaks and flakiness.
  • Refactors

    • Remove unused STAGEHAND_API_URL env scaffolding in api-multiregion tests.
    • Rename suite to “URL /v1 suffix handling” and document that getApiUrlForRegion always includes /v1.