Skip to content

feat(substrate): wire substrate into agentsessionsd and add demo - #134

Closed
Anish Ramasekar (aramase) wants to merge 49 commits into
mainfrom
aramase/f/poc_suite_sessions_substrate
Closed

Anish Ramasekar (aramase) wants to merge 49 commits into
mainfrom
aramase/f/poc_suite_sessions_substrate

Conversation

@aramase

Copy link
Copy Markdown
Collaborator

Substrate dropped the actor's external_snapshot field, breaking stateful forks. This fixes that and runs an AgentSuite agent as a substrate harness behind agentsessionsd.

  • The adapter clones the actor's latest completed snapshot.
  • Memory-tier Exec, Resume, Suspend and stateful Fork refuse a missing or replaced actor (FAILED_PRECONDITION) and a busy one (ABORTED); a resume NOT_FOUND is re-checked with GetActor. Gaps: a fork child's actor replaced before its first turn is accepted, and a turn placed before its actor is replaced runs on the replacement. Older daemons cannot verify these journals.
  • agentsessionsd refuses a model key over plain http unless the host is loopback, localhost or *.svc[.cluster.local].
  • examples/agentsuite-substrate runs the lifecycle on kind with a fake model or Azure OpenAI. Docker must publish on this machine's loopback; a remote DOCKER_HOST is not supported.

Tested: go test -race in all three modules (Azure stubbed), fake-model demo on arm64 kind. Not run: the demo against amd64 Docker, live Azure, gVisor e2e, micro-VM CI.

@gambtho

Tom Gamble (gambtho) commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Nice, this makes the suite → template → session path much easier to see. Suggest splitting: snapshot/fork fix first, then the actor-identity checks, daemon wiring, model transport, example.

  • On the two replacement gaps: the child needs its clone UID recorded at fork, and a placed turn needs an expected UID enforced at the router.
  • Restore with no journaled snapshot URI can report "memory state lost" for a missing template volume even when the original actor is still there.
  • Binding/model: agree on binding outside the suite. The model override in the demo lets the same suite run a different model. Render also doesn't check the image came from the suite's composition. You could leave that to kmx's lift side?
  • *.svc is a name check, not proof the traffic stays local; maybe call it a trusted-network exception.

@aramase

Copy link
Copy Markdown
Collaborator Author

Thanks, splitting it the way you suggested: snapshot/fork fix first, then the actor-identity checks, daemon wiring, model transport and the example, each on main with its own tests.

  • Restore with no journaled snapshot URI reporting "memory state lost" while the original actor is still there: fixing that in the split, with a test.
  • *.svc: agreed, I'll call it a trusted-network exception and drop the in-cluster wording.
  • Clone UID at fork and the expected UID at the router: follow-ups after the split; the router side needs a change in substrate's atenet-router.
  • Model: the next coordinator demo drops the override. The suite version pins the model and the binding says where it's served, matching your kmx convention.
  • Image-from-composition check: fine to leave that to kmx's lift side.

@gambtho

Copy link
Copy Markdown
Member

The integration binary keeps the vendor imports out of core. This still puts the Substrate flags and control setup in the root module, while our review guidance limits that exception to runtime/substrate. Can the wiring split keep those in the integration module and leave a neutral host hook, or make the wider boundary an explicit decision?

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.

2 participants