Skip to content

add caller-owned openhands agent server sessions - #55

Merged
twaldin merged 4 commits into
mainfrom
ticket/twa-102
Sep 10, 2026
Merged

add caller-owned openhands agent server sessions#55
twaldin merged 4 commits into
mainfrom
ticket/twa-102

Conversation

@twaldin

@twaldin twaldin commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Outcome

Add matching Python and TypeScript caller-owned OpenHands Agent Server HTTP/WebSocket sessions, pinned to 1.45.0. Optional dependencies stay lazy; OpenHands is session-only, with no CLI fallback.

  • Require explicit endpoint, server key, existing native agent profile, exact model and server-side workdir.
  • Preserve conversation UUID and exact resume; missing history fails without creation. Surface HTTP 409 (busy), retain ordered raw events/cumulative usage, and distinguish native finish/error/stuck/paused from disconnect.
  • Interrupt only an accepted owned run. Preserve an observed native finish if the interrupt request fails, but close the local handle to prevent unsafe follow-up. Close never kills the server or deletes history.
  • Retain existing session backends, including landed Claude/Amp fixes. No additional version bump or package publication.

Caller boundary

The caller must confirm the server has no unwanted automation callbacks/webhooks. Harness registers none, but cannot inspect or disable server-configured callbacks. Native-server synthetic-provider and authenticated-provider qualification remain NOT RUN / UNQUALIFIED: no caller endpoint or credentials were supplied. No provisioning or global/auth changes.

Validation

  • Linux/macOS CI: full Python, bare Bun, typecheck/build and all seven Node 22 package entrypoints passed. Linux totals: 2,188 Python and 1,694 Bun tests. The checkout includes current main 81cf980; its merge tree was verified explicitly.
  • Exact reviewed afee8ab and clean-merge 18b2fa6 archives: wheel/sdist/npm contents checked; installed Python (65 tests) and isolated Node 22 consumers passed, including missing optional ws before any HTTP request and 35 shared protocol cases plus lifecycle/configuration coverage.
  • Diagnosed and fixed a synthetic-peer late-accept/EOF ownership race, not production behavior. Fifty reproductions and full original conformance passed without relaxing protocol or cleanup deadlines. Local full Bun used a 15-second outer test-harness budget; CI defaults passed unchanged.
  • Separate final Standards and Spec reviews: verified Grok 4.6 xhigh, both PASS on afee8ab.
  • CodeRabbit's automatic review was rate-limited after readiness; this is an additional-coverage gap, not a completed review. No paid review or billing change requested.

Refs TWA-102

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 2 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 3 included reviews currently available. Your 78 included PR review attempts over the past 7 days set your current allowance at 3 reviews per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 42dc6a74-ca7d-48c2-abdc-23adc568f516

📥 Commits

Reviewing files that changed from the base of the PR and between 864efd3 and afee8ab.

⛔ Files ignored due to path filters (2)
  • ts/bun.lock is excluded by !**/*.lock
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • .github/workflows/lifecycle.yml
  • CONTRIBUTING.md
  • README.md
  • SPEC.md
  • pyproject.toml
  • src/harness/__init__.py
  • src/harness/_openhands.py
  • src/harness/sessions.py
  • tests/helpers/openhands_server.py
  • tests/openhands_cases.json
  • tests/test_openhands_sessions.py
  • ts/README.md
  • ts/package.json
  • ts/src/index.ts
  • ts/src/openhands.ts
  • ts/src/sessions.ts
  • ts/tests/node-openhands.mjs
  • ts/tests/openhands-conformance.mjs
  • ts/tests/openhands-sessions.test.ts

Comment @coderabbitai help to get the list of available commands.

Register accepted connections synchronously and refuse late accepts after shutdown starts. Cancel and await owned handler tasks as well as run tasks so a queued HTTP connection cannot escape the writer snapshot and stall server closure.
@twaldin twaldin changed the title Add caller-owned OpenHands Agent Server sessions add caller-owned openhands agent server sessions Sep 10, 2026
@twaldin
twaldin marked this pull request as ready for review September 10, 2026 03:38
@twaldin
twaldin merged commit 80237bd into main Sep 10, 2026
3 checks passed
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.

1 participant