Skip to content

Instantly share code, notes, and snippets.

View Ohadbasan's full-sized avatar

Ohad Basan Ohadbasan

  • Israel
View GitHub Profile
@Ohadbasan
Ohadbasan / mastra-repro.mjs
Created October 21, 2026 09:26
Mastra: durable supervisor resumed in a new instance with observational memory does not persist the sub-agent's next suspension
// Repro: with observational memory on, a durable supervisor resumed by a new Mastra instance does not
// persist its sub-agent's next suspension.
//
// A supervisor delegates to a sub-agent whose tool suspends twice (q1, then q2). The run suspends on
// q1, and a second Mastra instance on the same storage (a restarted server) resumes it. The sub-agent
// then suspends on q2. The run snapshot says so, but the thread's saved messages still record q1,
// and Mastra logs "addToolMetadata could not find an assistant message ... suspendedTools entry was
// not persisted". A reload built from those messages offers q1, and an answer to it reaches q2.
//
// Resuming in the same instance saves q2. So does a new instance with observational memory off.
{
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"ami_regions" : ["us-east-1"],
"source_ami": "ami-13be557e",
"instance_type": "c4.large",
"ssh_username": "ubuntu",
@Ohadbasan
Ohadbasan / gist:d361bd791797deffa046fa3f3ef52316
Created October 26, 2017 15:31
script disconnected unexpectedly - gcloud
2017/10/26 18:10:48 ui: googlecompute: - angstwad.docker_ubuntu (v3.3.2) was installed successfully
googlecompute: - angstwad.docker_ubuntu (v3.3.2) was installed successfully
2017/10/26 18:10:48 packer: 2017/10/26 18:10:48 Remote command exited without exit status or exit signal.
2017/10/26 18:10:48 packer: 2017/10/26 18:10:48 [INFO] RPC endpoint: Communicator ended with: 2300218
2017/10/26 18:10:48 [INFO] 20054 bytes written for 'stdout'
2017/10/26 18:10:48 [INFO] 1168 bytes written for 'stderr'
2017/10/26 18:10:48 [INFO] RPC client: Communicator ended with: 2300218
2017/10/26 18:10:48 [INFO] RPC endpoint: Communicator ended with: 2300218
2017/10/26 18:10:48 packer: 2017/10/26 18:10:48 [INFO] 20054 bytes written for 'stdout'
2017/10/26 18:10:48 packer: 2017/10/26 18:10:48 [INFO] 1168 bytes written for 'stderr'