Skip to content

Harden Antigravity Interactions harness HTTP client#285

Merged
zbl94 merged 2 commits into
mainfrom
interactions-harness-http-hardening
Jul 9, 2026
Merged

Harden Antigravity Interactions harness HTTP client#285
zbl94 merged 2 commits into
mainfrom
interactions-harness-http-hardening

Conversation

@zbl94

@zbl94 zbl94 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Fix a substrate suspend/resume failure and tighten the config surface:

  • Disable HTTP keep-alives on the harness's default client. On substrate the actor is suspended after a turn and resumed for the next (with a new routable IP), which leaves any pooled keep-alive connection stale; reusing it made the next turn's request fail. Opening a fresh connection per request avoids that at the cost of an extra handshake.
  • Remove the public HTTPClient override from AntigravityInteractionsConfig. External callers don't configure the harness's transport, and exposing it risked silently reintroducing the keep-alive bug. New now always owns its (keep-alive-disabled) client; tests inject a fake transport via an unexported newWithHTTPClient seam.
  • Reorder AntigravityInteractionsConfig fields to list required (Agent, StateDir) before optional, with clearer doc comments.

Build and package tests pass.

Fix a substrate suspend/resume failure and tighten the config surface:

- Disable HTTP keep-alives on the harness's default client. On substrate the
  actor is suspended after a turn and resumed for the next (with a new routable
  IP), which leaves any pooled keep-alive connection stale; reusing it made the
  next turn's request fail. Opening a fresh connection per request avoids that
  at the cost of an extra handshake.
- Remove the public HTTPClient override from AntigravityInteractionsConfig.
  External callers don't configure the harness's transport, and exposing it
  risked silently reintroducing the keep-alive bug. New now always owns its
  (keep-alive-disabled) client; tests inject a fake transport via an unexported
  newWithHTTPClient seam.
- Reorder AntigravityInteractionsConfig fields to list required (Agent,
  StateDir) before optional, with clearer doc comments.

Build and package tests pass.
@zbl94 zbl94 requested review from rakyll and wjjclaud July 9, 2026 19:43

@rakyll rakyll left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment. LGTM after it's addressed.

Comment thread internal/harness/antigravityinteractions/antigravityinteractions.go
Address review feedback: document that cloning DefaultTransport (rather than a
bare &http.Transport{}) is intentional -- it inherits the production defaults
(env proxy, dial/TLS/handshake timeouts, HTTP/2) and only overrides keep-alives.
A fresh empty transport would silently drop those.
@wjjclaud

wjjclaud commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Tested with @zbl94 on substrate. This fixed the connection issue on substrate.

@zbl94 zbl94 merged commit c9bacfb into main Jul 9, 2026
8 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.

3 participants