Skip to content

Add Bare agent suspend balance repro#124

Draft
coreymartin wants to merge 3 commits into
mainfrom
repro-bare-agent-suspend-balance
Draft

Add Bare agent suspend balance repro#124
coreymartin wants to merge 3 commits into
mainfrom
repro-bare-agent-suspend-balance

Conversation

@coreymartin
Copy link
Copy Markdown
Contributor

@coreymartin coreymartin commented May 8, 2026

Summary

Adds a Bare repro script for the agent suspend/resume balance behavior in spark-bare-app, including explicit bare-http1 / bare-https dependencies so the example resolves agent implementations that expose suspend() and resume().

The script now defaults to Nam's direct-await case:

  • enable SDK logging at TRACE by default
  • suspend the Bare HTTP/HTTPS agents
  • call await wallet.getBalance() directly while suspended, without wrapping that suspended balance call in Promise.race

The earlier watchdog comparison flow is still available with REPRO_MODE=race.

Included captured logs:

  • repro-agent-suspend-balance-direct.log: direct suspended getBalance() rejects immediately with AGENT_SUSPENDED, then cleanup exits normally.
  • repro-agent-suspend-balance-direct-no-cleanup.log: direct suspended getBalance() rejects immediately, but without cleanup the process remains alive on the background stream until the external timeout kills it.
  • Earlier race-mode logs are retained for comparison.

Findings

I was still not able to reproduce a foreground getBalance() call hanging forever. With SDK TRACE logging enabled and no Promise.race around the suspended balance call, the captured direct log shows BareHttpTransport failing request setup with AGENT_SUSPENDED and getBalance() rejecting in the same tick range.

The process-liveness issue remains reproducible: the no-cleanup direct run prints repro script completed, then continues receiving subscribe_to_events chunks until the external 45s timeout exits with code 124.

Public

Adds a public Bare repro script and captured logs for agent suspend/resume balance behavior. No production SDK behavior is changed.

Validation

  • yarn install --immutable
  • yarn workspace @buildonspark/spark-bare-app format
  • timeout 45 env WATCHDOG_MS=20000 NETWORK=MAINNET yarn workspace @buildonspark/spark-bare-app repro:agent-suspend-balance
  • timeout 45 env WATCHDOG_MS=20000 CLEANUP_CONNECTIONS=0 NETWORK=MAINNET yarn workspace @buildonspark/spark-bare-app repro:agent-suspend-balance

@coreymartin coreymartin changed the title [codex] Add Bare agent suspend balance repro Add Bare agent suspend balance repro May 8, 2026
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