Skip to content

Add durable conversation resumability to the Antigravity Interactions harness#180

Open
zbl94 wants to merge 2 commits into
mainfrom
interactions-resumability
Open

Add durable conversation resumability to the Antigravity Interactions harness#180
zbl94 wants to merge 2 commits into
mainfrom
interactions-resumability

Conversation

@zbl94

@zbl94 zbl94 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Introduce a small durable key-value store and use it to persist each conversation's interaction-chain cursor (the last interaction id), so a conversation can resume after a process restart instead of starting a new chain.

  • internal/storage: a minimal Store interface (Get/Put/Delete + ErrNotFound) with documented semantics (atomicity, read-after-write, not-found-vs-error, durability) and a single-writer concurrency model. Includes a filesystem implementation (FileStore) that writes atomically via temp-file + rename.
  • harness: add AntigravityInteractionsConfig.StateStore; Start loads any persisted cursor and Run persists it after each successful turn, so a fresh Execution for the same conversation continues the existing interaction chain.
  • harness: document the single-writer-per-conversation expectation on the Harness interface (the controller guarantees it), which is what makes the last-write-wins store correct.

Also includes related harness improvements:

  • Retry HTTP 429 (rate limit) with exponential backoff + jitter, honoring Retry-After; only 429 is retried since it is rejected before any interaction is created.
  • Terminology cleanup: the within-Run FC/FR loop is the "interaction loop" (continuation turns chained via previous_interaction_id), distinct from an AX-level resume.

… harness

Introduce a small durable key-value store and use it to persist each
conversation's interaction-chain cursor (the last interaction id), so a
conversation can resume after a process restart instead of starting a new chain.

- internal/storage: a minimal Store interface (Get/Put/Delete + ErrNotFound)
  with documented semantics (atomicity, read-after-write, not-found-vs-error,
  durability) and a single-writer concurrency model. Includes a filesystem
  implementation (FileStore) that writes atomically via temp-file + rename.
- harness: add AntigravityInteractionsConfig.StateStore; Start loads any
  persisted cursor and Run persists it after each successful turn, so a fresh
  Execution for the same conversation continues the existing interaction chain.
- harness: document the single-writer-per-conversation expectation on the
  Harness interface (the controller guarantees it), which is what makes the
  last-write-wins store correct.

Also includes related harness improvements:
- Retry HTTP 429 (rate limit) with exponential backoff + jitter, honoring
  Retry-After; only 429 is retried since it is rejected before any interaction
  is created.
- Terminology cleanup: the within-Run FC/FR loop is the "interaction loop"
  (continuation turns chained via previous_interaction_id), distinct from an
  AX-level resume.
@zbl94 zbl94 requested review from anj-s, joycel-github and rakyll June 26, 2026 16:15
Resolve conflict in internal/harness/antigravityinteractions.go:
main changed Harness.Start to take a harnessConfig []byte argument
(#193) while this branch added StateStore-backed resume-cursor loading
to Start. Combined both: Start now accepts harnessConfig, stores it on
the execution, and still loads any persisted resume cursor when a
StateStore is configured.

Build, vet, and full test suite pass.
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