Skip to content

test: cover package root import in git-dependency smoke test#288

Closed
VascoSch92 wants to merge 1 commit into
mainfrom
openhands/smoke-test-root-import
Closed

test: cover package root import in git-dependency smoke test#288
VascoSch92 wants to merge 1 commit into
mainfrom
openhands/smoke-test-root-import

Conversation

@VascoSch92

Copy link
Copy Markdown
Member
  • A human has tested these changes.

Why

Issue #135 ("Publish @openhands/typescript-client as an npm package") is functionally resolved as of @openhands/typescript-client@1.34.0: the package is published to the public npm registry, the vendor/ directory and file: reference are gone, and a clean Node ESM project can npm install it and import the root plus every subpath export.

The last blocker was the package root import failing with ERR_IMPORT_ATTRIBUTE_MISSING. The root barrel transitively loads models/acp.js, which imports acp-providers.json; in published ESM that import must carry a with { type: 'json' } attribute (added by scripts/rewrite-relative-imports.mjs during the build). That fix is already in the tree and verified in the build output (dist/models/acp.js), but the existing git-dependency smoke test only exercised the subpath exports (./clients, ./client/http-client, ./events/remote-events-list, ./workspace/remote-workspace) — never the root ., which was the exact import that used to crash. That left the regression uncovered.

This PR closes that coverage gap so the fix can't silently regress.

Summary

  • Add the package root import (import { ACP_PROVIDERS } from '@openhands/typescript-client') to scripts/smoke-test-git-dependency.mjs.
  • Touch the JSON-backed ACP_PROVIDERS export (and assert it loaded) so the smoke test fails loudly if the with { type: 'json' } attribute regresses and the root import throws ERR_IMPORT_ATTRIBUTE_MISSING again.

Issue Number

Fixes #135

How to Test

npm ci
npm run build
npm run test:git-dependency

The smoke test installs the package as a git dependency into a temp ESM project and imports the root + all subpaths. It prints the resolved export types and the ACP provider count, and throws if the root import fails to load the JSON-backed registry.

Additionally verified manually against a packed tarball in a clean type: module project:

root keys: 88
ACP_PROVIDERS: true
clients: 34
http-client: 2
remote-events-list: 1
remote-workspace: 1
ALL IMPORTS OK

Full local check suite also passes: npm run lint (0 errors), npm run format:check, npm run build, and npm run test (290 tests).

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

This is a test-only change; no runtime/library code is modified. The underlying JSON import-attribute fix already shipped in 1.34.0 — this simply pins the regression so future changes to the build/rewrite step keep the root import working.

This PR was created by an AI agent (OpenHands) on behalf of the user.

@VascoSch92 can click here to continue refining the PR

The ERR_IMPORT_ATTRIBUTE_MISSING regression that blocked issue #135
affected the package root import ('.') specifically: the barrel
transitively loads models/acp.js, which imports acp-providers.json and
must carry a 'with { type: json }' attribute in published ESM. The
git-dependency smoke test only exercised subpath exports, leaving that
exact failure path uncovered. Add the root import and touch the
JSON-backed ACP_PROVIDERS export so the smoke test fails if the
attribute regresses.

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions github-actions Bot added the type: test Adding or fixing tests label Jul 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Endpoint audit

❌ 40 off-contract call(s) — not on the agent-server · classifiers: cloud

Category Count
❌ Off-contract (not on agent-server) 40
  ⛔ no known backend 15
  ↗️ served by cloud 25
➕ Missing API (agent-server has, client lacks) 11
agent-server endpoints 121
client endpoints 148

❌ Not on agent-server (gated, 40)

⛔ (no known backend) — served by no backend we can see (15)

  • DELETE /api/automation/v1/{}
  • DELETE /api/meta-profiles/{}
  • GET /api/automation/health
  • GET /api/automation/v1
  • GET /api/automation/v1/{}
  • GET /api/automation/v1/{}/runs
  • GET /api/automation/v1/{}/tarball
  • GET /api/meta-profiles
  • GET /api/meta-profiles/{}
  • GET /api/v1/config/models/search{}
  • GET /api/v1/config/providers/search{}
  • PATCH /api/automation/v1/{}
  • POST /api/automation/v1/{}/dispatch
  • POST /api/meta-profiles/{}
  • POST /api/meta-profiles/{}/activate

↗️ served by cloud (25)

  • DELETE /api/v1/app-conversations/{}
  • DELETE /api/v1/secrets/{}
  • GET /api/keys/current
  • GET /api/organizations
  • GET /api/shared-events/search
  • GET /api/v1/app-conversations/search
  • GET /api/v1/app-conversations/{}/download
  • GET /api/v1/app-conversations/{}/file
  • GET /api/v1/git/branches/search
  • GET /api/v1/git/installations/search
  • GET /api/v1/git/repositories/search
  • GET /api/v1/secrets/search
  • GET /api/v1/settings
  • GET /api/v1/settings/agent-schema
  • GET /api/v1/settings/conversation-schema
  • GET /api/v1/skills/search
  • PATCH /api/v1/app-conversations/{}
  • POST /api/v1/app-conversations
  • POST /api/v1/app-conversations/{}/switch_acp_model
  • POST /api/v1/app-conversations/{}/switch_profile
  • POST /api/v1/sandboxes/{}/pause
  • POST /api/v1/sandboxes/{}/resume
  • POST /api/v1/secrets
  • POST /api/v1/settings
  • PUT /api/v1/secrets/{}

➕ Missing API — agent-server exposes it, client does not implement (11)

  • GET /
  • GET /api/conversations
  • GET /api/conversations/{}/events
  • GET /api/conversations/{}/workspace
  • GET /api/conversations/{}/workspace/{}
  • GET /api/file/archive
  • GET /api/git/commits
  • GET /api/git/commits/{}/changes
  • GET /api/init
  • POST /api/conversations/{}/load_plugin
  • POST /api/init

@VascoSch92 VascoSch92 closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: test Adding or fixing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 2] Publish @openhands/typescript-client as an npm package

2 participants