Proto commits in golemcloud/golem

These commits are when the Protocol Buffers files have changed: (only the last 100 relevant commits are shown)

Commit:5b17a1d
Author:Kaur Matas

Give no oplog page after the end of its range and correct the cursor help OplogRange::page_in gives no page when the first index in the oplog is after the end of the range. The check of the returned page then gives no resource, because the executor read no entry, and the check before the read keeps the whole range as its fallback. The --cursor help and the skill say that a cursor after --to is an invalid request, because --from cannot be used with --cursor. SearchOplogRequest.from_oplog_index says where a read without it starts. Amp-Thread-ID: https://ampcode.com/threads/T-9347dd39-2d86-463a-a56c-3f767ac56d72

Commit:a686825
Author:Kaur Matas
Committer:Kaur Matas

Label MCP name collisions by the name that collides, and project constraint text - Name collisions inside one tool and across the tools of an MCP deployment now name the root name and alias path that produced the MCP name, and the owning tool when the root name is a root alias or the mcp.name override. CompiledMcpToolExport stores mcp_root_name and mcp_command_path for this. - The constraint text in a tool description uses the snake_case argument names. - A name_override with no letter or digit fails. - The CLI round-trip test uses the snake_case argument and the custom-error envelope; a new CLI test checks the reserved-argument deploy error. - The MCP docs use kebab-case examples and active voice. Amp-Thread-ID: https://ampcode.com/threads/T-4fe1dc8b-bb48-4abe-bf9c-9a08a6e8969f

Commit:bc15d34
Author:Daniel Vigovszky

Validate invocation input against the selected execution revision Retain the original method input through durable acceptance and request equality. Decode and prepare streams only after the loaded Store selects the execution revision. Separate queued acceptance from readiness while preserving resume, observer, recovery and lifecycle ordering. Keep read-only cache observations as the explicit nonpersisted exception and verify their execution namespace before sharing results. Update the in-tree protocol consumers and diagnostic schema descriptions. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f414-ebf2-7153-9db5-8ac805c0d98d Co-authored-by: Amp <amp@ampcode.com>

Commit:fd02af3
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Implement agent ID HTTP mounts and creation routes Replace optional phantom selectors with required path or query ID bindings. Add constructor-completed create routes, lookup-only mounted file selection, and Rule 13 validation across the SDKs, registry and router. Synchronize the WIT, generated metadata, CLI output, documentation and acceptance fixtures. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f3c8-62f8-7648-a425-d84957592456

Commit:8461c99
Author:Daniel Vigovszky
Committer:GitHub

GOL-1051: Invocation cancellation outcome, invocation API and CLI (#4586) * Give a cancelled pending invocation the typed outcome `cancelled` A pending or scheduled invocation that is withdrawn now ends with `WorkerExecutorError::InvocationCancelled` on every surface: waiters are woken with it, a reused key answers it before and after a restart, lookup mode reports `Cancelled`, RPC maps it to a permanent `invocation-cancelled` error before and after acceptance, and REST answers 409 `INVOCATION_CANCELLED`. Cancelling the running invocation answers `CannotCancelRunningInvocation` (409) instead of "not found". `InvalidRequest` rejections are persisted as the cancellation + error pair, like `PermissionDenied`, so a rejection stays a failure after the warm cache is gone. A rejection pair written after a user cancellation does not replace that cancellation; the status keeps `withdrawn_again` so a pair split across reconstruction chunks is attributed the same. The invocation loop's withdrawal of a queued duplicate no longer replaces the existing result in the status, the persisted result index or the oplog fallback. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * Keep listing data on the per-invocation entries InvocationResultPosition records how an invocation ended, its operation, and when it was accepted and last changed. PendingInvocationRef records the operation. The running invocation is now a RunningInvocation with its request and last change. Worker::list_invocations and get_invocation merge the recent results, the persisted result index (or the oplog), the pending invocations and the running one, newest change first. The persisted result index is a cache of the oplog: it is now cleared with the cached status and on a cold status write, and an index field that does not decode resets it. Catch-up takes operations from the status and never decodes a payload again; missing ones are read from the request entry when listing. A withdrawn queued duplicate never replaces an existing result. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d * Add executor RPCs to get, list and look up invocations Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d * Add environment-scoped invocation REST endpoints The worker service exposes the invocations of an environment under /v1/runtime/envs/{environment_id}/invocations: list, look up by Idempotency-Key, get by invocation ID and cancel. Reads need View and cancel needs CancelInvocation on the agent; a reserved owner name, a missing component or an agent in another environment answers 404. Get returns the summary and, for a terminal invocation, its method value (decoded at the producing revision), tool result or failure. A result that cannot be read or decoded is left out with a warning. Invoke-agent and invoke-tool responses carry Golem-Invocation-Id and Golem-Environment-Id. The old DELETE of an invocation by idempotency key is removed; the CLI, ssh and the test DSL cancel through the new endpoint. The executor's agent lookup now returns the stored output instead of only the status, and the session protocol lets a lookup that names no method or tool accept either result kind. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d * Add the golem invocation CLI commands and docs Add `golem invocation get|list|cancel`, which select an invocation by its ID or by its agent and idempotency key, and remove `agent cancel-invocation`. Update the CLI output schema, skills, docs, executor docs and the OpenAPI response docs for the invocation headers. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d * fixup! Keep listing data on the per-invocation entries Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add executor RPCs to get, list and look up invocations Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d * fixup! Give a cancelled pending invocation the typed outcome `cancelled` Cancel asks the worker to decide under its instance lock before it reads a recent result. A running invocation with a retry marker answers the typed 409, and a queued invocation with a warm fail-fast error is withdrawn. The withdrawal drops that cached error, so a later lookup reads the committed cancellation. A keyed lookup whose recent entry is the withdrawal of a queued duplicate reads an older result of the key from the persisted index first, so the key keeps its result after that result left the recent results. Also ports the tests to the 2.0 caller and the new error entry fields. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Keep listing data on the per-invocation entries Ports the listing data to the 2.0 caller and the struct variant of SaveSnapshot. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add executor RPCs to get, list and look up invocations Ports the invocation reads to the 2.0 caller. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add environment-scoped invocation REST endpoints Only a recorded invocation failure fills the result of a failed invocation. Any other lookup error, such as an unavailable executor, leaves the result empty with a warning. Also ports the lookup to the 2.0 caller. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add the golem invocation CLI commands and docs `invocation get --agent --idempotency-key` without `--method` shows every invocation the key selects, each with its operation, as the new `invocation.get-matches` output when there is more than one. It exits 130 when any of them is cancelled. `invocation cancel` still needs `--method` for such a key. The ssh cancel reads the typed CANNOT_CANCEL_RUNNING_INVOCATION code as the normal still-running answer. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Give a cancelled pending invocation the typed outcome `cancelled` The lookup in the cancel test names its caller, which every invocation start needs now. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add environment-scoped invocation REST endpoints The lookup of a completed method names its caller, which every invocation start needs now. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Give a cancelled pending invocation the typed outcome `cancelled` The tests name the provenance of the failures they store, which every error trap carries now. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add executor RPCs to get, list and look up invocations Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add environment-scoped invocation REST endpoints Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Keep listing data on the per-invocation entries Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add environment-scoped invocation REST endpoints Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Keep listing data on the per-invocation entries Store the request operation on PendingAgentInvocation and AgentInvocationStarted next to a payload without the operation, so that readers of the operation never download or decode the payload. Remove the oplog scans for an incomplete index. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Keep listing data on the per-invocation entries Normalize the command path of a tool invocation to the canonical command names, and reject at deploy time a tool whose longest operation is above the operation size limit of the invocation index. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> * fixup! Add environment-scoped invocation REST endpoints Cache the tool deployment state of the current deployment in the worker service, with the same generation-based invalidation and TTL as the current component metadata. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>

The documentation is generated from this commit.

Commit:c9d75b7
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Retain named HTTP method argument bindings Resolve compiled HTTP bindings by argument and JSON property names instead of binding-vector positions. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f414-ebf2-7153-9db5-8ac805c0d98d Co-authored-by: Amp <amp@ampcode.com>

Commit:4434f32
Author:Kaur Matas

Give OplogRange the resume, count, end and page rules of an oplog read The executor readers, oplog_page_start and the permission rule use the OplogRange rules. A cursor outside the range is an invalid request. GetOplogRequest and SearchOplogRequest give from_oplog_index one shape. The range test checks that the history is in the blob layer before it reads. Amp-Thread-ID: https://ampcode.com/threads/T-9347dd39-2d86-463a-a56c-3f767ac56d72

Commit:8012149
Author:Aditya Salunkhe

Merge upstream main

Commit:0a449e3
Author:Aditya Salunkhe
Committer:Aditya Salunkhe

Merge upstream main

Commit:a4a9f00
Author:Simon Schenk
Committer:Simon Schenk

GOL-1493: Select installed tools by local declaration Use the declaration name for registry and binding lookups, and keep the published name for guest dispatch on the pinned component revision. Load unlocked development package paths as local manifests. Amp-Thread-ID: https://ampcode.com/threads/T-4f5c0115-4b55-4d4b-b9c0-f6f96a62b6a4

Commit:0467402
Author:Dávid István Bíró
Committer:Dávid István Bíró

Record where a diverged replay started

Commit:e4b96bf
Author:Dávid István Bíró

Merge main into typed config

Commit:3140ba2
Author:Dávid István Bíró

Carry native config defaults through metadata

Commit:57dca64
Author:Daniel Vigovszky
Committer:GitHub

Make agent IDs UUIDv8 and address agents by key or ID (#4567) * Make AgentId a UUIDv8 that carries its type tag AgentId is a version 8 UUID: the 32-bit type tag, then 90 bits of H. Golem issues every ID. The derivations of H are methods of AgentId, with golden vectors, including the new allocated and external-tool-owner derivations. - AgentTarget is Key(AgentKey) or Id(AgentId). - ParsedAgentKey has no phantom ID and parses key text only. - OwnedAgentId::storage_key() is {env-uuid}/{agent-uuid}. - The Create entry records the constructor parameters, has no original phantom ID, and its public projection carries the agent type name. - Agent filters match by key or by ID instead of by name. - A card owner leaf is an agent ID with the trusted type name, so a type wildcard compares type names. - The wallet ID, stream ID, attachment ID and invocation ID text hash or print the agent UUID. - The WIT and proto agent-id hold only the UUID. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 * Address agents by key or ID in the internal gRPC APIs Executor create and invoke requests carry an AgentKey or an AgentTarget, the implementing component, and a pre-allocated ID for agents without a key. Worker-service requests name their environment. Adds the executor LookupAgent RPC, the registry ResolveTypeId RPC, and the AgentKeyCollision execution error. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 * Adapt golem-service-base to UUID agent IDs The blob agent path segment is the agent ID text. A webhook ID carries the agent ID and its checksum binds the environment instead of the component, under the bumped agent-webhook-id:v2 domain. Adds the AgentKeyCollision executor error. AgentId::from_parts is public so tests in other crates can build IDs. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Resolve type IDs through the registry The registry serves ResolveTypeId over the M1 type ID rows, so removed types still resolve, and adds the implementing component when an agent type is deployed. TypeIdResolutionCache caches names without invalidation, never caches a miss, and drops implementers per environment. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Key agent storage by environment and agent ID Every indexed, key-value and blob layer stores an agent under {environment}/{agent} text. A per-type scan reads the prefix {environment}/{type tag}-, the sweep reads the environment from the key, and listing is per agent type. Promises, oplog processor idempotency keys and the sandbox filesystem path carry the environment. The instance name checks are removed, and the remaining name parses read the Create entry. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Resolve executor targets by key or ID The executor resolves every request target to the agent ID it reaches and the owner it may create. A key target derives the keyed ID from the key canonicalized against the implementing component; an ID target with a constructor creates an agent without a key at a pre-allocated ID; an ID target alone reaches only an existing agent. Keyed joins check the stored canonical key and fail with AgentKeyCollision. RPC, the worker proxy and the direct invocation auth work on the resolved target, and phantom IDs are gone from replay and agent creation. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID from guest code The guest WIT replaces wasm-rpc new with upsert, get-by-id and an async create that returns the issued agent ID. The agent host gains lookup-agent-id, get-agents lists the agents of one agent type, fork-agent returns the issued ID, and oplog processors no longer receive a component. The host derives keyed IDs from recorded agent types, allocates unkeyed and forked IDs from the Start index, and reports key conflicts as rpc-error conflict. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Adapt executor unit tests to UUID agent IDs Test fixtures build agent IDs from a type tag and a hash instead of a component and a name. Tests of behavior that no longer exists are removed: environment lookups by component in the oplog sweep, separators inside agent names, and sandbox paths for long agent names. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Serve the runtime REST API by agent key or ID The worker service addresses agents under /v1/runtime/envs/{env}: create, upsert, lookup and per-type listing by agent type, and management by agent ID with an optional expected fingerprint. Requests to an agent authorize against its Create entry before they report it missing. Deployed agent types and type tags resolve through registry lookups that a deployment invalidates. Both routers send /v1/runtime to the worker service, and the OpenAPI spec, golem-client and the REST docs follow the new endpoints. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Adapt the shared test DSLs to UUID agent IDs The test DSL addresses an agent by OwnedAgentId. Starting an agent upserts its key, or creates it exclusively when the test sets environment or config overrides. Listing is per agent type, and promises complete in an environment. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the CLI An agent address is a key, Type(params), or an ID, Type[uuid] or a bare UUID. Keys resolve to IDs through the lookup endpoint. agent new becomes agent create and agent upsert, invocations take an expected fingerprint, listing and cursors are per agent type, and redeploy recreates only keyed agents at their IDs. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the Rust SDK Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the TypeScript SDK, bridge and REPL Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the Effect SDK Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the Go SDK Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the MoonBit SDK Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Address agents by key or ID in the Scala SDK Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Pass the constructor parameters to load-snapshot The agent ID no longer holds the constructor parameters, so the executor passes them to the guest load-snapshot export, in the form initialize received them. Every SDK gives them to user restore code again, and the snapshot envelopes keep their previous format. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Generate bridges that address agents by key or ID Every bridge generator emits upsert, create, getById and agentId for the runtime REST API and the guest RPC API. External bridges resolve the environment ID from the configured names in the account of the token, and streaming sessions connect to the session endpoint of that environment, retrying the lookup only while the server is unavailable. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Read the agent ID in the bash tool and the OTLP exporter The bash tool's hostname reads GOLEM_AGENT_ID. The OTLP exporter keys agents by environment and agent ID, takes the service name from the agent type, and no longer receives a component ID in process. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Describe agent keys and agent IDs in skills, docs and templates Skills, the skill harness scenarios, the next docs, the CLI templates and the home-page snippets use upsert, create, get by ID and agent IDs, the agent create/upsert commands, key and id filters, and the GOLEM_AGENT_* variables. The how-to guides are regenerated from the skills. Frozen docs versions are no longer typechecked against the in-tree SDKs. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Adapt test components to agent keys and IDs Test components use upsert, create and get by ID, typed agent IDs and the GOLEM_AGENT_* variables, implement load-snapshot with the constructor parameters and the oplog-processor process export without a component ID, and are rebuilt. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Adapt executor integration tests to agent keys and IDs Executor tests address agents by key or by ID, compare owners and identities by UUID, and expect the GOLEM_AGENT_ID, GOLEM_AGENT_KEY and GOLEM_AGENT_TYPE variables. New tests cover a key whose ID holds an agent of another key, a guest create without a key that crashes before its End, archived agents reached by key and by ID, and the deletion of an agent whose type the component no longer implements. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Adapt registry service tests to UUID agent IDs Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Adapt integration tests to agent keys and IDs New tests cover the agent create, upsert, lookup, list and invoke endpoints: keyed and unkeyed creates, idempotency keys from the header only, callers without a scope, stale expected fingerprints, per-type listing, no component ID in agent responses, type tags that follow the registry type ID across redeploys, and the status of every management endpoint for strangers and for unknown agents. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Test agent keys and IDs in the CLI Unit tests cover the create, upsert and invoke flags, agent addresses, list filters and the multi-type list cursor. Integration tests cover a keyed create, upsert and expected fingerprints, deploy with redeployed agents, multi-type paging and the REPL create and upsert scripts. The existing CLI tests use the upsert and create constructors. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com> * Update rate-limit fixture to UUID agent identities Key agent principals by UUID and use the keyed upsert client for the rate-limit backend. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Remove redundant copies of UUID agent identities Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Align integration fixtures with UUID agent addressing Read registered type IDs from the deployed environment. Exercise explicit ephemeral IDs and environment-scoped REST and WebSocket routes. Keep wallet update fixtures on the UUID contract and correct the CLI diagnostic assertion. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d * Keep fault-matrix fixture guide migrations Include the managed guides generated while building the fault-matrix applications with the current CLI. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d * Refresh rate-limit fixture lockfile for merged SDK Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Bind management mutations to the authorized agent incarnation Carry the checked fingerprint through executor RPCs and routing retries. Validate it at lifecycle admission so a replacement generation cannot inherit an admitted mutation. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Validate unkeyed and ephemeral constructors without key limits Keep the canonical key byte limit on keyed addressing. Carry typed constructors directly through creation and remote dispatch, and give ephemeral RPC proxies a separate logical identity. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Report authorized lookup collisions instead of absence An occupied keyed address returns AgentKeyCollision after authorization. Preserve lookup-only behavior and identical denial responses for callers without access. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Document full UUID comparisons for agent ID filters Use FilterComparator rather than string comparators in both listing tables and regenerate OpenAPI and REST documentation. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Move remaining runtime consumers to environment-scoped routes Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Reject keyed redeploy when the new constructor changes its key Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Restore processor snapshots with an empty constructor record Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Check key ownership before file reads and failed invocation responses Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Authorize missing agent IDs against their path environment Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Filter component agent selection by recorded ownership Add the optional component_name query to public per-type list and find. Component-scoped CLI listing and bulk operations send this filter. Keep recorded component IDs inside the worker client and authorize each result against its recorded component. Public metadata remains component-free. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d * Resolve retained agent types and select recorded component owners Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Bind getById to the recorded agent schema during execution and replay Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Keep executor type ID lookups safe across invalidation and cancellation Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Migrate cross-SDK acceptance peers to opaque agent identities Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Keep component identity in agent list cursors Key page and non-page continuations by component ID and type so a moved type does not restart an earlier component scan. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Supply caller in direct identity invocation test Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Refresh managed fixture guides during component builds Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Display the recorded component in type-only agent lists Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Complete Effect Caller migration after the main merge Use ordinary constructor codecs and invocation context instead of removed Principal injection. Restore snapshots without a saved principal and refresh generated agent metadata declarations. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Record raw HTTP binding and reattachment causes Keep the response and retry behavior unchanged while exposing the failing boundary for intermittent raw HTTP requests. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Decode Scala agent callers with opaque UUID IDs The Caller migration must use the current agent-id record. The component/name decoder traps before an agent-to-agent invocation can execute. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Drain HTTP responses after request-side closure The executor can stop consuming input before its final responses arrive. Do not abandon those responses and attempt to resume an ephemeral invocation. Reattach only when the response stream is lost. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Retry component reads through deployment invalidation bursts Global deployment invalidations can exhaust three attempts even when a component is unchanged. Keep generation fencing and bound invalidation retries by a 30-second window instead. Preserve cancellation-safe cache producers and verify both burst recovery and retry-window exhaustion. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Accept incomplete HTTP messages on immediate response body failure Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Keep CLI agent enrichment on the listed incarnation Reuse operation-local deployment history and match recorded ownership against the listed fingerprint and component revision. Keep obfuscated oplog lookup diagnostics out of normal command output and migrate its fixtures to current agent APIs. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com> * Restore caller probes after the Principal migration Use the current caller display and claims helpers in the Rust SDK fixture while retaining UUID invocation owners and upsert clients. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d * Keep the identity redeploy test on the versioned fixture Main's counter update fixture now changes component_version only for SnapshotCounter. Exercise that type so the test continues to distinguish a newly deployed agent from its retained predecessor. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d --------- Co-authored-by: Amp <amp@ampcode.com>

Commit:a10675e
Author:Kaur Matas
Committer:Kaur Matas

feat(sharding): carry the executor lease count Deliver the lease-holder count with registration, renewal and full assignments. Accept it with the existing revision and incarnation gate, including count-only renewals for executors that keep their shards. The shard manager and executor wire contract changes together. No old message format or compatibility path is retained. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f2d6-3397-76bc-af91-6e1e81a13a53

Commit:6aae7ee
Author:Dávid István Bíró

Resolve defaults into revisioned config captures

Commit:90bd1e5
Author:Aditya Salunkhe

Keep the claims of a public caller as the original JSON object text

Commit:dd63030
Author:Aditya Salunkhe
Committer:Aditya Salunkhe

Merge upstream main

Commit:7bba11c
Author:Daniel Vigovszky
Committer:GitHub

Merge branch 'main' into gol-1051-invocation-api

Commit:45c55da
Author:Simon Schenk
Committer:GitHub

Return a bounded obfuscated oplog report over MCP (GOL-2140) (#4563) * Return a bounded obfuscated oplog report over MCP (GOL-2140) * Keep only the error code of an oplog export failure outside the export A failure of agent_oplog_export outside the export itself, such as an agent ID that does not resolve, used the error of the command tools. That error can use the log of the command as its message, and the log can quote the agent ID. The tool now keeps only the error code, and the service and the HTTP status of a service error. * Keep an oplog export failure out of the log and drop unknown error codes A failed agent_oplog_export call could still quote the agent ID in two places. The CLI logged the failed resolution to the stderr of the MCP server, and the switch to stderr after the call also wrote the log that it held back. The call now runs with no log and no tracing output. A server response can also have any error code, so the tool keeps only the codes of a failed resolution or read, and reports other codes as command-failed. * Do not trace the requests of golem mcp serve rmcp traces each request that golem mcp serve receives, with its arguments, at debug level. This happens before the call starts, so the silent call of agent_oplog_export does not cover it, and an argument can be data of an agent. The CLI now shows rmcp tracing only from warn level, as for poem and opentelemetry. GOLEM_LOG_FILTER can still enable it.

Commit:209f7fd
Author:Simon Schenk

GOL-1420c: the never-live mark, enforced A fork can carry the never-live mark. A marked agent starts only for a pending update, replays its history, writes one update outcome and stops. Its replay ends in the Ended phase instead of going live, and the host-call decision table refuses every durable call that would execute now unless it is local. Native peer boundaries refuse before the native call, and the socket policy is the floor under them. A refusal stays typed up to the outcome table, where it is NotReplayable.

Commit:a650c8f
Author:Aditya Salunkhe

Merge upstream main

Commit:6416ca6
Author:Kaur Matas

Label MCP name collisions by the name that collides, and project constraint text - Name collisions inside one tool and across the tools of an MCP deployment now name the root name and alias path that produced the MCP name, and the owning tool when the root name is a root alias or the mcp.name override. CompiledMcpToolExport stores mcp_root_name and mcp_command_path for this. - The constraint text in a tool description uses the snake_case argument names. - A name_override with no letter or digit fails. - The CLI round-trip test uses the snake_case argument and the custom-error envelope; a new CLI test checks the reserved-argument deploy error. - The MCP docs use kebab-case examples and active voice. Amp-Thread-ID: https://ampcode.com/threads/T-4fe1dc8b-bb48-4abe-bf9c-9a08a6e8969f

Commit:d4c310e
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Add executor RPCs to get, list and look up invocations Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d

Commit:9147a8f
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Give a cancelled pending invocation the typed outcome `cancelled` A pending or scheduled invocation that is withdrawn now ends with `WorkerExecutorError::InvocationCancelled` on every surface: waiters are woken with it, a reused key answers it before and after a restart, lookup mode reports `Cancelled`, RPC maps it to a permanent `invocation-cancelled` error before and after acceptance, and REST answers 409 `INVOCATION_CANCELLED`. Cancelling the running invocation answers `CannotCancelRunningInvocation` (409) instead of "not found". `InvalidRequest` rejections are persisted as the cancellation + error pair, like `PermissionDenied`, so a rejection stays a failure after the warm cache is gone. A rejection pair written after a user cancellation does not replace that cancellation; the status keeps `withdrawn_again` so a pair split across reconstruction chunks is attributed the same. The invocation loop's withdrawal of a queued duplicate no longer replaces the existing result in the status, the persisted result index or the oplog fallback. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8d8-ce48-74f4-8298-f572f30b3a6d Co-authored-by: Amp <amp@ampcode.com>

Commit:5affb15
Author:Simon Schenk
Committer:GitHub

GOL-1420b: the never-live mark, stored and shown (#4541) * Store the never-live mark in the Create entry CreateParameters gets never_live, next to create_request. Agent creation writes false, and nothing sets true yet. The mark goes through the desert form, the raw and public protos, the Create projection, the public oplog and the WIT create-parameters and raw-create-parameters, the SDK bindings that carry them, and the hand-written oplog wrappers of the Scala and TypeScript SDKs. The status fold copies the mark from Create into AgentStatusRecord and keeps it through later folds. The delivery snapshot that an oplog processor receives keeps it too. The CLI oplog view shows it on a marked Create entry, and the oplog export obfuscator keeps it. * Report the Sandboxed status for a never-live agent AgentStatus gets Sandboxed as its last variant: proto value 7, WIT sandboxed, the OpenAPI enum and every SDK binding. The status fold never writes it. AgentStatusRecord::reported_status() gives Sandboxed when the never-live mark is set and the folded status otherwise, and underlying_status() gives the folded status of a marked agent. Every outward view reads the reported status: the filter's status leaf, so `status = sandboxed` finds a marked agent; the guest projection AgentMetadataForGuests, which feeds the guest's metadata and enumeration; the running fast path of enumeration; the enumeration fallback for an agent whose status cannot be rebuilt, which starts from the metadata of its Create entry; the status metrics; and the executor gRPC metadata and the plugin metadata. AgentMetadataDto and the proto AgentMetadata (field 23) carry underlying_status, set only when the status is Sandboxed. Control code keeps deciding by the folded status. The exhaustive matches on it get an explicit Sandboxed arm that refuses: an interrupt and an automatic update are ignored, a resume is rejected, and a promise does not activate the agent. The CLI shows "Sandboxed (replayed state: X)" in `agent get`, colours the status, and `agent ssh` refuses a sandboxed agent with its own message. An executor test checks after a real restart that an ordinary agent's Create entry has no mark and that its metadata has no underlying status.

Commit:e8269b1
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Implement agent ID HTTP mounts and creation routes Replace optional phantom selectors with required path or query ID bindings. Add constructor-completed create routes, lookup-only mounted file selection, and Rule 13 validation across the SDKs, registry and router. Synchronize the WIT, generated metadata, CLI output, documentation and acceptance fixtures. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f3c8-62f8-7648-a425-d84957592456

Commit:4bad9e9
Author:Daniel Vigovszky

Merge structured replay divergence from origin/main Keep UUID agent identities while adopting structured replay divergence and failure classes. Regenerate Go bindings and adapt new replay and permission tests to environment-scoped UUID targets. Amp-Thread-ID: T-01a1ef3f-d7bc-70df-918a-e077f6e5612d

Commit:6b53c8e
Author:Daniel Vigovszky

Merge origin/main into gol-1019-uuidv8-agent-ids Preserve UUID agent targets and fingerprint checks while adopting Caller authority. Regenerate SDK bindings and retain constructor inputs during snapshot restore. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:813e608
Author:Simon Schenk
Committer:GitHub

GOL-1420a: the structured divergence and the failure class (#4537) * Add the replay divergence and update failure class types ReplayDivergence names the first oplog index at which a replay left the recorded history, the recorded step there and the step that the replay took instead. UpdateFailureClass says why an update failed. Both have a serde, OpenAPI, desert and protobuf form. Two host calls compare their requests by schema graph and by the bits of their float leaves, so the equality stays reflexive for a request that holds a NaN. * Carry a structured divergence with an oplog index in UnexpectedOplogEntry `WorkerExecutorError::UnexpectedOplogEntry` now carries a `ReplayDivergence`: the oplog index of the first divergence, the expected and the actual step, and the mismatched identity fields of a host call. Every producer gives the index of the entry that it names. A missing `Start` names the first entry that the claiming owner would consume next, or the end of the recorded history. A `Start` with the same invocation ID and a different identity names that `Start` and lists the fields that differ. The expected step is the recorded history and the actual step is what the replay did. A producer that compares a replayed action with a recorded entry puts the recorded entry in `expected`. A read past the end of the history gives `EndOfHistory` as the expected step, and a read at the invocation boundary gives `InvocationEnd` as the actual step. Producers that check an invariant of the recorded history alone keep their texts. Unclosed abandoned `Start`s name the lowest open index. A claim that must find its recorded `Start` runs with strict historical admission, also in a Store that continued live locally. When the `Start` is missing, the divergence names the entry that the cursor holds, the end of the history, or the deleted-region `Start` at its own index, with the claimed call as the actual step. The gRPC form keeps the structure. A request that has no protobuf form is left out of its own host call; the other request stays. The text form starts with "Unexpected oplog entry at <index>". * Record the failure class and the divergence on FailedUpdate `FailedUpdate` carries a required `failure_class` and an optional `divergence`, in the raw and the public oplog, in the agent status, in the update records of the agent metadata, in gRPC and in WIT. The start outcome table sets the class from the problem of the failed start, and a replay that failed at a recorded entry gives its divergence. Cancellations by a fork and failures of a manual update before its replay have the class `Other`. The raw entry does not keep the request of the expected call, because the recorded `Start` at the index holds it. The public oplog and the agent metadata read it from that `Start` and project it like the request of a public `Start`. Responses to external callers redact the host-managed values in both requests of the divergence, in the public oplog and in the agent metadata, as they do for the request of a public `Start`. The Go bindings are regenerated from the new WIT with the Go binding generator. * Classify failed updates by the provenance of the failure A failed replay, a failed snapshot load and a failed instantiation now carry a FailureProvenance. The provenance tells a trap in the target code apart from a failure of the host or of the lifecycle. failure_class uses the provenance to give TargetTrap, TargetRejected, Operational or Interrupted instead of the class of the start problem alone. * Show the failure class and the divergence of a failed update golem agent oplog renders the class, the divergence index, both replay steps, the mismatched identity fields and the expected and actual requests of a FailedUpdate. golem agent get shows the update history with the class and the divergence of each failed update. A restart test checks that the class and the divergence of a diverging automatic update stay in the agent metadata and in the public oplog after the executor restarts. The durable execution skill and the executor walkthrough describe the structured divergence and the class. * Check that a Go guest reads the divergence of a failed update A Go test agent reads the failed updates of its own oplog through `GetOplog` and `SearchOplog`. The test appends two `FailedUpdate` hints to the oplog of the agent. The first names a recorded `Start` as the expected host call and a replayed call with another request as the actual host call. The second has no request on either side. The agent sees the request of the recorded `Start` and the replayed request as two different values in the first divergence, and no request in the second, through both readers. * Authorize the divergence of a guest-supplied failed update `enrich-oplog-entries` reads the recorded `Start` at the index of the divergence of a failed update to give its expected request. The guest supplies that index, so the oplog grant must now cover it, as well as the index of each entry. The repair of an incomplete call reads the entries of the current guest arguments, which an updated guest can change after the recorded `Start` was authorized. The repair now checks the grant for that read set again, and completes the call with the denial when the grant refuses it. The requests of the divergence of a raw failed update can also hold owned capability handles and owned streams. They are now deleted from the resource table and the batch is rejected, as for the agent config of a `Create`. A rejected stream is disposed of as a guest drop of the resource does, so the endpoint of an unread durable input cancels its source. The stream resolvers of the executor share that disposal with the resource drop. * Classify an exit as an interruption in every replay, load and save A guest exit during the replay for an update is a lifecycle failure, as `failure_provenance` gives for every other exit. The failed update then has the class `Interrupted` and not `TargetTrap`. An exit in the load hook of a snapshot recovery now has the provenance `Lifecycle`, not `TargetReturned`, and an exit in the snapshot load of a manual update has it too. Both give the class `Interrupted`. A manual update whose load exits still fails, as before. The snapshot save of a manual update that exits or is interrupted now records the class `Interrupted`. Its other failures keep the class `Other`.

Commit:c2df3a1
Author:Kaur Matas

Export an agent oplog range as JSON Lines `golem agent oplog` gets `--to`, and `--query` combines with `--from` and `--to`. `--output FILE --format jsonl` writes the entries of the range to a file, one `agent.oplog` document per line, in index order, page by page. The REST oplog endpoint gets the `to` parameter and accepts `from` together with `query`; the executor page and search read no entry after `to`. Amp-Thread-ID: https://ampcode.com/threads/T-9347dd39-2d86-463a-a56c-3f767ac56d72

Commit:3a25710
Author:Daniel Vigovszky

Resolve retained agent types and select recorded component owners Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:2cbc1e1
Author:Aditya Salunkhe

Merge the GOL-1259 branch

Commit:cf1f22e
Author:Aditya Salunkhe
Committer:Aditya Salunkhe

Merge upstream main

Commit:146781c
Author:Aditya Salunkhe

Merge upstream main

Commit:bc1a58e
Author:Aditya Salunkhe

GOL-1257: Give every Golem-started invocation its caller Snapshot save and load run with the agent in both roles. An oplog processor batch runs with the account that installed the plugin as the original caller and the processed agent as the immediate caller; the first batch is the processor's recorded creator. InstalledPlugin gains installed_by, set from the authenticated actor at install and deploy time, and ProcessOplogEntriesRequest carries the batch caller. All Golem-started callers come from golem_started::GolemStartedWork, and a source scan refuses Caller::anonymous() outside the two entry points that start no work. Existing-only loads drop their unused caller argument. Signed-off-by: Aditya Salunkhe <aditya.salunkh919@gmail.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1f375-97cb-703d-bd5d-56af27f9ca70

Commit:5bae063
Author:Aditya Salunkhe
Committer:GitHub

GOL-1255: Replace the 1.6 principal with the 2.0 caller in every invocation (#4504) * Replace the 1.6 principal with the caller model in WIT, protobuf and golem-common * Build callers at the worker service entry points and follow 4.1 Rule 18 for read-only responses * Rust SDK: ctx.caller() and PrincipalRef replace principal injection * Update the CLI for callers instead of principals * Rust SDK: build the caller types without the agent export feature, and refresh a fixture lockfile * TypeScript SDK: ctx.caller and PrincipalRef replace principal injection * Go SDK: ctx.Caller() and PrincipalRef replace principal injection * MoonBit SDK: ctx.caller() and PrincipalRef replace principal injection * MoonBit tool-streaming component: read the caller from the invocation context * Effect SDK: InvocationContext.caller and PrincipalRef replace the Principal service * Scala SDK: ctx.caller and PrincipalRef replace principal injection * Give the executor one recorded caller per invocation and refuse a missing caller * Regenerate OpenAPI and REST docs for the caller model * Update the test support and the test suites for callers instead of principals * TypeScript SDK: refuse the caller types in tool signatures and results with the shared message * Effect SDK: refuse the caller types in tool signatures and results with the shared message * Rust SDK: refuse the caller types in results and value types with the shared message * Rust SDK: regenerate the compile-fail outputs with the CI compiler * Rust SDK: format with the CI rustfmt * Persist the generated Golem issuer and require it for standalone services * Refuse a protobuf token provenance without an id * Give the trusted resume test request an explicit anonymous caller * Reserve the old principal field names in the protobuf messages that now carry a caller * Explain that snapshot calls record no caller * MoonBit SDK: drop the unused agent common import from tool-core * Scala test agents: compare the principal text against its JSON-encoded form * Update the constructor probe in agent-counters to the invocation context API * Name the tool principal type in the mcp import middleware fixture * Give test requests a caller, dump the OpenAPI without a Golem issuer, and remove SDK and CI matrix leftovers * Keep the Golem issuer in the registry database, vary private read-only answers on credentials, store equal caller roles once, and refuse a late first caller read in the SDKs * Declare the MoonBit JSON snapshot writer as raising and give the method failure fixture an invocation context * Read the creator in the Scala principal sample agent while its constructor call runs * Send a caller in the method failure stream and lookup test requests * Keep the caller of a call that returns a stream for its producer * Refuse ordinary serialization of live callers and principals * Read only the current snapshot envelope versions in the SDKs * Format the caller serialization tests * Remove an unused import from the durable host module * Expect the 1.6 binary envelopes to be refused in the TypeScript envelope test * Read the 1.6 snapshot envelopes again in the SDKs for the bridge import * Format the Scala guest * Make the ETag of a read-only response specific to its caller * Describe the caller in the executor walkthrough and the durable execution skill * Build the expected ETag from the test session's caller in the phantom selector test * Keep the caller for a stream that a tool middleware returns

Commit:b9a752f
Author:Daniel Vigovszky

Authorize missing agent IDs against their path environment Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:60673a8
Author:Aditya Salunkhe
Committer:Aditya Salunkhe

Merge the GOL-1259 branch

Commit:59d1fa1
Author:Aditya Salunkhe

Carry the claims choice as ClaimVisibility from REST to the executor

Commit:a224c52
Author:Daniel Vigovszky

Check key ownership before file reads and failed invocation responses Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:71d8b62
Author:Kaur Matas
Committer:Kaur Matas

Keep oplog reads at or after a persisted retained start A new oplog layer reads the retained start of each agent oplog from a persistent key-value record. A read below the start fails as expired and names the start; the Create entry at index 1 stays readable. Every reader that started at index 1 starts at the retained start. The expired cause crosses gRPC as OplogExpired and REST as OPLOG_EXPIRED. Nothing moves the start yet, so every oplog still starts at index 1. Amp-Thread-ID: https://ampcode.com/threads/T-9347dd39-2d86-463a-a56c-3f767ac56d72

Commit:519bf57
Author:Daniel Vigovszky
Committer:GitHub

Wait out long retry backoffs in the call instead of trapping (GOL-1058) (#4573) * Wait out long retry backoffs in the call instead of trapping An in-function retry whose policy delay is above max_in_function_retry_delay fell back to a trap, which failed the whole invocation and reconstructed the agent. Now a call that can wait durably (an accessor call with a runtime activity, on a durable agent, outside snapshotting) waits the delay on a runtime timer of its activity and retries in place. The suspension coordinator sees that timer as a passive wait, as it sees a guest sleep, so an otherwise idle agent can suspend and wake at the deadline. The direct &mut ctx path, ephemeral agents, snapshot mode and delays above 100 years keep the trap fallback. The Error oplog entry gains retry_at, the wall-clock deadline of the backoff, on every in-function retry. The status fold keeps the furthest deadline per retry_from in AgentStatusRecord::current_retry_at; errors without one are ignored, so neither a sibling's shorter backoff nor its trap can shorten a longer one when calls of one entity body share a retry point. Repair of a Start left incomplete during the wait first waits retry_at - now, so a suspension, restart or early wakeup does not shorten the backoff. The delay is not recomputed on repair because jitter makes it nondeterministic. Call sites: the generic accessor helper (MCP tool calls), P3 HTTP send (transport and status-code retries), P3 response-body resume, and async RPC get, which waits through the guest call's activity and resends under the same idempotency key with RPC retry properties. Before a durable wait, a P3 send drains a request body that is not yet replayable, so the resend after the wait or after a restart has the whole body. retry_at is propagated through the proto, WIT and all its copies, the public oplog, CLI rendering, the oplog obfuscator, the CLI output schema, OpenAPI, the Go bindings and the TS, Effect and Scala declarations. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ee55-fba7-7782-a880-a77df94cbc84 * Key the retry deadline by the waiting call's Start The Error entry records retrying_start_index, the Start of the host call that waits until retry_at. The status fold keeps one deadline per waiting call and removes it at that call's End or Cancelled, so calls that share a retry point (entity bodies, custom-operation scopes, protocol parents) no longer delay each other's repair, and a finished or cancelled call's deadline no longer delays a later call. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ee55-fba7-7782-a880-a77df94cbc84 --------- Co-authored-by: Amp <amp@ampcode.com>

Commit:beaa61a
Author:Daniel Vigovszky

Bind management mutations to the authorized agent incarnation Carry the checked fingerprint through executor RPCs and routing retries. Validate it at lifecycle admission so a replacement generation cannot inherit an admitted mutation. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:6c7c02d
Author:Aditya Salunkhe

Merge the GOL-1259 branch

Commit:5e85d77
Author:Daniel Vigovszky

Key the retry deadline by the waiting call's Start The Error entry records retrying_start_index, the Start of the host call that waits until retry_at. The status fold keeps one deadline per waiting call and removes it at that call's End or Cancelled, so calls that share a retry point (entity bodies, custom-operation scopes, protocol parents) no longer delay each other's repair, and a finished or cancelled call's deadline no longer delays a later call. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ee55-fba7-7782-a880-a77df94cbc84

Commit:e981290
Author:Aditya Salunkhe

Accept shown claims in their text form when they hold a number beyond f64

Commit:198ae18
Author:Daniel Vigovszky

Merge latest main into UUID agent identity branch Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:7d6ee55
Author:Kaur Matas
Committer:Kaur Matas

feat(sharding): carry the executor lease count Deliver the lease-holder count with registration, renewal and full assignments. Accept it with the existing revision and incarnation gate, including count-only renewals for executors that keep their shards. The shard manager and executor wire contract changes together. No old message format or compatibility path is retained. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f2d6-3397-76bc-af91-6e1e81a13a53

Commit:84d7a57
Author:Simon Schenk

Return a bounded obfuscated oplog report over MCP (GOL-2140)

Commit:9846939
Author:Aditya Salunkhe

Merge the GOL-1259 branch

Commit:c126ad5
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Wait out long retry backoffs in the call instead of trapping An in-function retry whose policy delay is above max_in_function_retry_delay fell back to a trap, which failed the whole invocation and reconstructed the agent. Now a call that can wait durably (an accessor call with a runtime activity, on a durable agent, outside snapshotting) waits the delay on a runtime timer of its activity and retries in place. The suspension coordinator sees that timer as a passive wait, as it sees a guest sleep, so an otherwise idle agent can suspend and wake at the deadline. The direct &mut ctx path, ephemeral agents, snapshot mode and delays above 100 years keep the trap fallback. The Error oplog entry gains retry_at, the wall-clock deadline of the backoff, on every in-function retry. The status fold keeps the furthest deadline per retry_from in AgentStatusRecord::current_retry_at; errors without one are ignored, so neither a sibling's shorter backoff nor its trap can shorten a longer one when calls of one entity body share a retry point. Repair of a Start left incomplete during the wait first waits retry_at - now, so a suspension, restart or early wakeup does not shorten the backoff. The delay is not recomputed on repair because jitter makes it nondeterministic. Call sites: the generic accessor helper (MCP tool calls), P3 HTTP send (transport and status-code retries), P3 response-body resume, and async RPC get, which waits through the guest call's activity and resends under the same idempotency key with RPC retry properties. Before a durable wait, a P3 send drains a request body that is not yet replayable, so the resend after the wait or after a restart has the whole body. retry_at is propagated through the proto, WIT and all its copies, the public oplog, CLI rendering, the oplog obfuscator, the CLI output schema, OpenAPI, the Go bindings and the TS, Effect and Scala declarations. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1ee55-fba7-7782-a880-a77df94cbc84

Commit:7e5e4b8
Author:Aditya Salunkhe

Merge the GOL-1255 branch

Commit:af0ed2d
Author:Aditya Salunkhe

Merge the GOL-1255 branch

Commit:95e6a9b
Author:Aditya Salunkhe

Merge upstream main

Commit:796706a
Author:Daniel Vigovszky

Merge origin/main into gol-1019-uuidv8-agent-ids Keep UUIDv8 agent identities and type-scoped listing while retaining task attribution, query binding, tool output, and paged MCP reads from main. Amp-Thread-ID: https://ampcode.com/threads/T-01a1ef3f-d7bc-70df-918a-e077f6e5612d Co-authored-by: Amp <amp@ampcode.com>

Commit:acae7e8
Author:Daniel Vigovszky
Committer:GitHub

GOL-1096: Add tool HTTP declarations, composition and validation (#4550) * Add tool HTTP declarations across descriptors and SDKs Carry mounts, endpoints and prefixes through tool metadata and all six SDKs. Compose routes and resolve effective mode at the shared schema boundary. Validate HTTP declarations without changing invocation compatibility. Repair shared tagged-union OpenAPI schemas and reject unsupported payload shapes independently of recursive registration order. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-d872-714a-9db5-c3b3349d3ea1 Co-authored-by: Amp <amp@ampcode.com> * Update cross-SDK fixtures to current Result and collection APIs Check independently settled result and output channels before unwrapping. Use tagged Results and nanosecond Datetime values in the rich corpus. Refresh generated-client lockfiles and managed application guidance. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-d872-714a-9db5-c3b3349d3ea1 Co-authored-by: Amp <amp@ampcode.com> * Fix tool HTTP declaration validation and diagnostics Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-d872-714a-9db5-c3b3349d3ea1 Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>

Commit:951f1b9
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Serve the runtime REST API by agent key or ID The worker service addresses agents under /v1/runtime/envs/{env}: create, upsert, lookup and per-type listing by agent type, and management by agent ID with an optional expected fingerprint. Requests to an agent authorize against its Create entry before they report it missing. Deployed agent types and type tags resolve through registry lookups that a deployment invalidates. Both routers send /v1/runtime to the worker service, and the OpenAPI spec, golem-client and the REST docs follow the new endpoints. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com>

Commit:be136e0
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Address agents by key or ID from guest code The guest WIT replaces wasm-rpc new with upsert, get-by-id and an async create that returns the issued agent ID. The agent host gains lookup-agent-id, get-agents lists the agents of one agent type, fork-agent returns the issued ID, and oplog processors no longer receive a component. The host derives keyed IDs from recorded agent types, allocates unkeyed and forked IDs from the Start index, and reports key conflicts as rpc-error conflict. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com>

Commit:74190f9
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Resolve executor targets by key or ID The executor resolves every request target to the agent ID it reaches and the owner it may create. A key target derives the keyed ID from the key canonicalized against the implementing component; an ID target with a constructor creates an agent without a key at a pre-allocated ID; an ID target alone reaches only an existing agent. Keyed joins check the stored canonical key and fail with AgentKeyCollision. RPC, the worker proxy and the direct invocation auth work on the resolved target, and phantom IDs are gone from replay and agent creation. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345 Co-authored-by: Amp <amp@ampcode.com>

Commit:9de5ffb
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Address agents by key or ID in the internal gRPC APIs Executor create and invoke requests carry an AgentKey or an AgentTarget, the implementing component, and a pre-allocated ID for agents without a key. Worker-service requests name their environment. Adds the executor LookupAgent RPC, the registry ResolveTypeId RPC, and the AgentKeyCollision execution error. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345

Commit:d01683f
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Make AgentId a UUIDv8 that carries its type tag AgentId is a version 8 UUID: the 32-bit type tag, then 90 bits of H. Golem issues every ID. The derivations of H are methods of AgentId, with golden vectors, including the new allocated and external-tool-owner derivations. - AgentTarget is Key(AgentKey) or Id(AgentId). - ParsedAgentKey has no phantom ID and parses key text only. - OwnedAgentId::storage_key() is {env-uuid}/{agent-uuid}. - The Create entry records the constructor parameters, has no original phantom ID, and its public projection carries the agent type name. - Agent filters match by key or by ID instead of by name. - A card owner leaf is an agent ID with the trusted type name, so a type wildcard compares type names. - The wallet ID, stream ID, attachment ID and invocation ID text hash or print the agent UUID. - The WIT and proto agent-id hold only the UUID. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e38f-2fda-7122-bad5-5b547fd33345

Commit:fb17b8d
Author:Daniel Vigovszky
Committer:GitHub

GOL-1094: Implicit query binding and collection forms for agent endpoints (#4546) * GOL-1094: Bind agent endpoint queries implicitly and support collections Infer remaining GET, HEAD and DELETE inputs in the registry compiler. Parse repeated scalar lists and flat maps, validate original schemas and reject unknown query keys on typed endpoints before effects. Align SDK schema checks and OpenAPI with the query forms. Preserve file and raw-handler query passthrough and cover the contract with deployed Rust and TypeScript endpoints. Amp-Thread-ID: T-01a1e8df-c894-76c5-968e-f121dbe5d0c2 * GOL-1094: Align HTTP integration expectations with query bindings Use query-free DurableStreams URLs for methods without query inputs. Check rejection of undeclared phantom selectors separately from identity policy. Update extraction bindings and OpenAPI goldens for the query fixtures. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-c894-76c5-968e-f121dbe5d0c2 Co-authored-by: Amp <amp@ampcode.com> * Fix query binding validation and protocol errors Preserve typed parsing failures and match phantom selector conflicts by query wire names. Return bare DurableStreams validation errors and document repeated option presence. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-c894-76c5-968e-f121dbe5d0c2 * Make query validation diagnostics deterministic and precise Sort decoded query names before validation and report scalar map aliases against their original input fields before cache or body work. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-c894-76c5-968e-f121dbe5d0c2 Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>

Commit:64c58d9
Author:Simon Schenk
Committer:Simon Schenk

Record the failure class and the divergence on FailedUpdate `FailedUpdate` carries a required `failure_class` and an optional `divergence`, in the raw and the public oplog, in the agent status, in the update records of the agent metadata, in gRPC and in WIT. The start outcome table sets the class from the problem of the failed start, and a replay that failed at a recorded entry gives its divergence. Cancellations by a fork and failures of a manual update before its replay have the class `Other`. The raw entry does not keep the request of the expected call, because the recorded `Start` at the index holds it. The public oplog and the agent metadata read it from that `Start` and project it like the request of a public `Start`. Responses to external callers redact the host-managed values in both requests of the divergence, in the public oplog and in the agent metadata, as they do for the request of a public `Start`. The Go bindings are regenerated from the new WIT with the Go binding generator.

Commit:0ddf8c3
Author:Simon Schenk
Committer:Simon Schenk

Carry a structured divergence with an oplog index in UnexpectedOplogEntry `WorkerExecutorError::UnexpectedOplogEntry` now carries a `ReplayDivergence`: the oplog index of the first divergence, the expected and the actual step, and the mismatched identity fields of a host call. Every producer gives the index of the entry that it names. A missing `Start` names the first entry that the claiming owner would consume next, or the end of the recorded history. A `Start` with the same invocation ID and a different identity names that `Start` and lists the fields that differ. The expected step is the recorded history and the actual step is what the replay did. A producer that compares a replayed action with a recorded entry puts the recorded entry in `expected`. A read past the end of the history gives `EndOfHistory` as the expected step, and a read at the invocation boundary gives `InvocationEnd` as the actual step. Producers that check an invariant of the recorded history alone keep their texts. Unclosed abandoned `Start`s name the lowest open index. A claim that must find its recorded `Start` runs with strict historical admission, also in a Store that continued live locally. When the `Start` is missing, the divergence names the entry that the cursor holds, the end of the history, or the deleted-region `Start` at its own index, with the claimed call as the actual step. The gRPC form keeps the structure. A request that has no protobuf form is left out of its own host call; the other request stays. The text form starts with "Unexpected oplog entry at <index>".

Commit:1a25de8
Author:Simon Schenk
Committer:Simon Schenk

Add the replay divergence and update failure class types ReplayDivergence names the first oplog index at which a replay left the recorded history, the recorded step there and the step that the replay took instead. UpdateFailureClass says why an update failed. Both have a serde, OpenAPI, desert and protobuf form. Two host calls compare their requests by schema graph and by the bits of their float leaves, so the equality stays reflexive for a request that holds a NaN.

Commit:09527ce
Author:Dávid István Bíró

Merge main into typed config groundwork

Commit:540be1b
Author:Aditya Salunkhe

Record the requester of an update in the oplog model, protobuf and WIT

Commit:25a9368
Author:Daniel Vigovszky

Merge origin/main into GOL-1082 Resolve the conflict in tool_invoke.rs by keeping ToolInvokeHelpView and the terminal env overlay builder. The oplog export obfuscator renders the env overlay of an entity invocation: names stay, values are customer data. The sockets code that landed with GOL-1177 still named CustomInvocationContext, which GOL-1055 renamed to GuestTaskContext; rename it so main builds. Amp-Thread-ID: https://ampcode.com/threads/T-01a1de75-0d18-7295-b395-b2f01565ff02 Co-authored-by: Amp <amp@ampcode.com>

Commit:3d17d3e
Author:Daniel Vigovszky

Merge origin/main into agent query bindings Amp-Thread-ID: T-01a1e8df-c894-76c5-968e-f121dbe5d0c2

Commit:ff58cf2
Author:Aditya Salunkhe

Give each call that an agent or tool makes the original caller and the agent or tool as immediate caller

Commit:056a657
Author:Aditya Salunkhe

Show the caller of each invocation in the executor's public oplog, with claims only on request

Commit:90d85ac
Author:Aditya Salunkhe

Add Caller::propagate and a registry marker for the built-in bash binding

Commit:fd564b4
Author:Aditya Salunkhe

Add the public form of a caller to the public oplog model, protobuf and WIT

Commit:08904cf
Author:Aditya Salunkhe

Merge upstream main

Commit:6ef4a13
Author:Daniel Vigovszky
Committer:Daniel Vigovszky

Add tool HTTP declarations across descriptors and SDKs Carry mounts, endpoints and prefixes through tool metadata and all six SDKs. Compose routes and resolve effective mode at the shared schema boundary. Validate HTTP declarations without changing invocation compatibility. Repair shared tagged-union OpenAPI schemas and reject unsupported payload shapes independently of recursive registration order. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e8df-d872-714a-9db5-c3b3349d3ea1 Co-authored-by: Amp <amp@ampcode.com>

Commit:7694bd9
Author:Aditya Salunkhe

Keep the Golem issuer in the registry database, vary private read-only answers on credentials, store equal caller roles once, and refuse a late first caller read in the SDKs

Commit:5493f91
Author:Simon Schenk
Committer:Simon Schenk

Report the Sandboxed status for a never-live agent AgentStatus gets Sandboxed as its last variant: proto value 7, WIT sandboxed, the OpenAPI enum and every SDK binding. The status fold never writes it. AgentStatusRecord::reported_status() gives Sandboxed when the never-live mark is set and the folded status otherwise, and underlying_status() gives the folded status of a marked agent. Every outward view reads the reported status: the filter's status leaf, so `status = sandboxed` finds a marked agent; the guest projection AgentMetadataForGuests, which feeds the guest's metadata and enumeration; the running fast path of enumeration; the enumeration fallback for an agent whose status cannot be rebuilt, which starts from the metadata of its Create entry; the status metrics; and the executor gRPC metadata and the plugin metadata. AgentMetadataDto and the proto AgentMetadata (field 23) carry underlying_status, set only when the status is Sandboxed. Control code keeps deciding by the folded status. The exhaustive matches on it get an explicit Sandboxed arm that refuses: an interrupt and an automatic update are ignored, a resume is rejected, and a promise does not activate the agent. The CLI shows "Sandboxed (replayed state: X)" in `agent get`, colours the status, and `agent ssh` refuses a sandboxed agent with its own message. An executor test checks after a real restart that an ordinary agent's Create entry has no mark and that its metadata has no underlying status.

Commit:5c456b6
Author:Daniel Vigovszky

GOL-1094: Bind agent endpoint queries implicitly and support collections Infer remaining GET, HEAD and DELETE inputs in the registry compiler. Parse repeated scalar lists and flat maps, validate original schemas and reject unknown query keys on typed endpoints before effects. Align SDK schema checks and OpenAPI with the query forms. Preserve file and raw-handler query passthrough and cover the contract with deployed Rust and TypeScript endpoints. Amp-Thread-ID: T-01a1e8df-c894-76c5-968e-f121dbe5d0c2

Commit:61215a7
Author:Simon Schenk
Committer:GitHub

Stop oplog search and agent listing at a scan budget (#4461) * Stop oplog search and agent listing at a scan budget An oplog search and an agent listing scan storage until they fill a page. A rare match or a large count made one call scan the whole oplog or every agent of the component. A call now stops when it has scanned `limits.scan_budget.entries` entries (default 100,000) or run for `limits.scan_budget.time` (default 5s), and returns a partial page with a cursor. The caller continues with the cursor. The CLI follows cursors until the end, so it still reads every entry and every agent. The search counts every oplog entry that it reads, matching or not, and reads at least one chunk per call, so each call makes progress. The guest `search-oplog` iterator uses the same budget. The agent listing scans in batches of `limits.agent_scan_batch_size` agents (default 100) and checks the budget between batches. Each `get-next` call of a guest search adds entries to the oplog of the caller. With a small budget, a search of its own oplog that read up to the current end on every call never reached it. The first batch of a guest search now fixes the last entry that the search reads. The `GolemApiOplogChunk` response records it, so replay restores it. A `get-oplog` read keeps following the end of the oplog: it reads a page of 100 entries per call, which is more than one call adds. An oplog page now has a cursor if and only if the oplog has entries after the page. Before, an empty page had no cursor, so a search that the budget stopped before a match looked like the end of the oplog. A cursor that points past the last entry of the oplog is stale. The executor refuses it with the new `WorkerExecutorError::StaleCursor`, which crosses gRPC as the `stale_cursor` case of `WorkerExecutionError`, and the worker service returns it as 400 Bad Request with the code `STALE_CURSOR`, so a client can tell it from other bad input and start again without a cursor. The revision in the cursor is not checked, because that would scan the oplog from its start on every page. A page count of 0 is refused, because its cursor would never move. The oplog viewer of `golem agent oplog --serve`/`--html` and the executor test DSL follow a cursor past an empty page. The DSL no longer reads a trailing empty page, so it reads the oplog sooner. The P3 socket snapshot test read its baseline as soon as the initialization snapshot existed, before the snapshot of its `received` call, and now often failed. It now waits for a snapshot after the start of that call. * Charge examined keys to the agent listing budget The agent listing asks the storage for at most the remaining budget, but Redis `SCAN COUNT` is only a hint, and a scan can return more keys. The listing does not cut a batch, because a cut batch loses keys. It charges the keys that the scan examined, so the budget is a soft bound that can overshoot by one storage batch. The `scan_budget` setting says so. `OplogService::scan_for_component` now also gives the number of keys that the scan examined. The multi-layer oplog service takes this number before it removes the agents that a lower layer lists. Before, an archived agent with a primary tail cost nothing, so a listing with a small budget could walk a long run of such agents until its time budget ended. A guest search can now get an empty batch before a later match. The Scala test agent `OplogInspector` reads on until a batch has results or the search ends, and the `next` documentation says that a batch can be empty before the end. * Tie an oplog cursor to the query of its pages A search cursor held only the next oplog index and the component revision. A caller could continue it with another query, or with a read without a query, and the results changed without an error. `OplogCursor` now also holds `query_hash`: the first 8 bytes of the SHA-256 of the search query as the caller sent it, in lowercase hex. The cursor of a read without a query has an empty hash. The string form of the cursor is `<index>-<revision>-<query hash>`, and the old form without a hash is invalid. The executor refuses a cursor whose hash is not the hash of the query of the read, before it reads the oplog. `WorkerExecutorError::StaleCursor` now has a reason: `PastEnd`, with the last index of the oplog, or `QueryMismatch`. The reason crosses gRPC as a oneof of the `StaleCursor` message. The REST API returns both reasons with the code `STALE_CURSOR`, and the error text tells them apart. The oplog viewer of `golem agent oplog --serve` sends the hash back with the cursor. * Check the query of an oplog cursor before resolving the agent A get or search of the oplog compared the query hash of its cursor only in `oplog_page_start`, after it resolved the agent identity. The resolution reads the mode cache and the `Create` entry of the oplog. A cursor of another query thus read storage before the executor refused it, and it failed with an identity or storage error when that read failed, not with the stale cursor error. The new function `check_oplog_cursor_query` makes the comparison and reads no storage. The get and search handlers call it right after they validate the agent ID and the shard, before they resolve the agent. `oplog_page_start` now only checks that the cursor is not past the end of the oplog. The executor test of the query hash now also reads an agent that does not exist. A cursor of the same query fails to resolve the agent, and a cursor of another query is refused with `QueryMismatch`. The `stale_reason` test helper copies the reason instead of cloning it, because clippy refuses a clone of a `Copy` type. * Test that the agent listing stops after the batch that spends its budget The Redis listing test checks that the cursors skip no agent and repeat none, but it also passes when a call consumes two storage batches, and when the listing charges the listed agents instead of the examined keys. A new unit test drives `DefaultWorkerEnumerationService` over scripted storage batches with a budget of three keys. Its batches list no agent: the multi-layer oplog service drops the agents that a lower layer also has, and counts their keys as examined. The test checks the key counts that the listing asks the storage for: - After a batch of two examined keys, the listing asks for one key and stops after it. A listing that charged the listed agents would ask for three keys again. - When the storage answers a request for three keys with five, as Redis `SCAN COUNT` can, the listing stops after that batch and does not ask for the next one. The comments of the Redis test now say what it checks, and name the new test for the stop rule.

Commit:4e2c0fc
Author:Daniel Vigovszky
Committer:GitHub

Enable wasm GC, function references and exceptions (#4351) * Upgrade Golem to Wasmtime 50 and wit-bindgen 0.63 Adapt durable host calls and HTTP transport to the v50 APIs while preserving explicit concurrent import boundaries and the existing engine feature policy. Use the published Wasmtime and wit-bindgen forks and the unmerged wasm-rquickjs upgrade. Refresh Rust and JavaScript guest bindings, dependency locks, and the concurrent runtime fixtures. Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Migrate MoonBit cancellation and component linkage Use cancellation-safe defers and explicit checks after shields. Preserve shared results and release capabilities when cancellation interrupts encoding or output completion. Update the compiler-facing tooling and generate foreign-library components whose registration runs at instantiation, without executable entry points or Preview 1 imports. Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Align build toolchains with the runtime upgrade Pin wasm-rquickjs installations to the unmerged upgrade revision and teach orb setup to install Git revisions. Align MoonBit compiler pins with the migrated SDK and use Wasmtime 50 for built-in Bash validation. Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Pin the wasm-rquickjs PR with refreshed component notices Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Restore socket admission and stabilize v50 executor regressions Enable TCP and UDP in the existing socket admission branch. Use canonical component memory references and establish the unreferenced timer clock boundary through a real HTTP dependency before replay. Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Preserve Bash recursion headroom with Wasmtime 50 Use a 1 MiB Wasm stack budget and retain 1.5 MiB for host calls. Apply the same limits in the shared production engine and Bash conformance runners. Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Pin the socket and cancellation fixes from runtime forks Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Align MoonBit tool discovery and count flags with the new compiler Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Align MoonBit SDK bindings and trait methods with the new compiler Pin the corrected MoonBit generator and reject stale installed revisions. Make trait method promotion explicit, remove unused imports, and retain intentional Result-valued APIs and cancellation-aware failure handling. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 * Use the current MoonBit workspace and tool execution contract Generate moon.mod and moon.work manifests, resolve source dependencies before code generation, and use pinned moonx packages for published tools. Derive workspace artifact paths from the application name and invalidate cached templates when it changes. Update bridge generation, fixtures, and release transforms for the pinned compiler. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 * Document MoonBit workspaces and pinned moonx tools Align canonical skills, generated guides, and SDK guidance with the application and bridge manifests. Explain workspace artifact paths, local overrides, provider build ordering, and the required registry prebuilt asset. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 * Build the MoonBit RPC fixture from its owning workspace Set the external command directory to the SDK workspace so dependency preparation and compilation resolve the same local modules. Keep the managed guide refreshed by the fixture rebuild. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 * Use the runtime fix for ArkType class import methods Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Align CLI MoonBit fixtures with foreign-library workspaces Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Stabilize Bash oracle find results before filtering Amp-Thread-ID: https://ampcode.com/threads/T-01a18bf5-8bac-760f-923d-adf2adb65618 Co-authored-by: Amp <amp@ampcode.com> * Enable wasm GC, function references and exceptions Every Golem engine now validates and runs components that use the wasm GC, function-references and exception-handling proposals. GC heap growth counts like linear memory: the durable resource limiter applies admission, the agent memory limit, plan quotas and GrowMemory hints to it, and the reload memory requirement includes the GC heap capacity. Uncaught wasm exceptions are deterministic traps and are not retried. The wasmtime fork pin moves to a commit that propagates limiter errors during GC heap growth instead of ignoring them. The new gc-heap test component composes a Rust agent with a GC probe module and backs the executor tests for GC heap accounting and exceptions. Amp-Thread-ID: https://ampcode.com/threads/T-01a191c6-0c6e-735c-bddd-13fdf4fa7848 Co-authored-by: Amp <amp@ampcode.com> * Enable wasm GC, function references and exceptions Every Golem engine now validates and runs components that use the wasm GC, function-references and exception-handling proposals. GC heap growth counts like linear memory: the durable resource limiter applies admission, the agent memory limit, plan quotas and GrowMemory hints to it, and the reload memory requirement includes the GC heap capacity. Uncaught wasm exceptions are deterministic traps and are not retried. The wasmtime fork pin moves to a commit that propagates limiter errors during GC heap growth instead of ignoring them. The new gc-heap test component composes a Rust agent with a GC probe module and backs the executor tests for GC heap accounting and exceptions. Amp-Thread-ID: https://ampcode.com/threads/T-01a191c6-0c6e-735c-bddd-13fdf4fa7848 Co-authored-by: Amp <amp@ampcode.com> * Reconcile reconstructed GC memory before live execution Admit reconstructed linear and GC memory before allocation and reconcile the absolute memory baseline at the replay-to-live boundary. Propagate the reconciliation hint through oplog consumers and generated contracts. Cover admission, reconstruction, restart, invocation identity and terminal pairing with real memory grants and composed GC fixtures. Copy the composed fixture for both build presets. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Fix GC accounting publication and reconstruction review findings Preserve pending admission, order memory reconciliation with live growth, finalize snapshot allocation, and export absolute memory totals. Exercise real GC reconstruction and limiter accounting with independent observations. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Allow GC collection after recoverable memory growth refusal Preserve immediate typed errors for linear memory and initial GC allocation. Retain quota and capacity refusal context for terminal GC exhaustion without changing the Wasmtime fork. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Classify GC instruction traps consistently for agents and tools Share deterministic guest-trap classification and preserve typed host-context precedence at tool boundaries. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Move memory accounting commit barriers to Worker Keep baseline cutover synchronous in the tracker and retain generation-scoped commit receipts in Worker. Preserve cancellation joining, authoritative failures and snapshot reset ordering. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Clarify GC limiter refusal and accounting documentation Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Consolidate memory tracker transition state Keep the shared transition gate for metering and Worker receipt identity. Protect transition-owned flags, provisional allocations and grants with private tracker state, preserving callback ordering and cancellation behavior. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Construct memory trackers in their instantiating state Separate the saved memory baseline and prepaid reservation from allocated bytes. Pass historical admission independently of replay and remove the post-construction reset. Preserve fixture allocation phases and metering clocks. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba * Share memory reservation shrinking without changing policy Share grant shrinking and quota enforcement between live publication and failed growth. Keep each caller's target and eligibility rules, release private locks before callbacks, and preserve preparation's separate tracked-grant decision. Remove the duplicate grow_at wrapper. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba * Clarify per-Store memory accounting terminology Define the tracker total as linear-memory allocation plus GC heap capacity. Distinguish provisional allocation from reservations and baselines, and correct metric descriptions without changing their names or sampling. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba * Consolidate GC test helpers and fixture build steps Preserve production-context and preparation-probe coverage while sharing memory history, configuration and supplied resource entries. Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> * Count initializer allocation once across replay cutover Retain the accounting baseline selected during instantiation and record only the remaining allocation at final reconciliation. Preserve idempotent retries and forced resets under the existing transition lock. Cover tracker and receipt transitions, real Wasmtime initialization, and executor recovery from a committed initializer prefix. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba * Preserve initializer growth before live publication Use the captured accounting baseline even while replay publication is pending. Serialize primary instantiation finalization with generation-scoped accounting receipts and commit its residual through the lifecycle actor. Retain finalization completion across cancellation, retries and resets. Cover pending cursor publication with real core-start allocation and exercise receipt failure and cancellation. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba * Handle reconciled memory in oplog exports Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>

Commit:ad95c0a
Author:Simon Schenk
Committer:Simon Schenk

Store the never-live mark in the Create entry CreateParameters gets never_live, next to create_request. Agent creation writes false, and nothing sets true yet. The mark goes through the desert form, the raw and public protos, the Create projection, the public oplog and the WIT create-parameters and raw-create-parameters, the SDK bindings that carry them, and the hand-written oplog wrappers of the Scala and TypeScript SDKs. The status fold copies the mark from Create into AgentStatusRecord and keeps it through later folds. The delivery snapshot that an oplog processor receives keeps it too. The CLI oplog view shows it on a marked Create entry, and the oplog export obfuscator keeps it.

Commit:f4ed064
Author:Simon Schenk
Committer:Simon Schenk

Record the failure class and the divergence on FailedUpdate `FailedUpdate` carries a required `failure_class` and an optional `divergence`, in the raw and the public oplog, in the agent status, in the update records of the agent metadata, in gRPC and in WIT. The start outcome table sets the class from the problem of the failed start, and a replay that failed at a recorded entry gives its divergence. Cancellations by a fork and failures of a manual update before its replay have the class `Other`. The raw entry does not keep the request of the expected call, because the recorded `Start` at the index holds it. The public oplog and the agent metadata read it from that `Start` and project it like the request of a public `Start`. Responses to external callers redact the host-managed values in both requests of the divergence, in the public oplog and in the agent metadata, as they do for the request of a public `Start`. The Go bindings are regenerated from the new WIT with the Go binding generator.

Commit:eefea12
Author:Simon Schenk
Committer:Simon Schenk

Carry a structured divergence with an oplog index in UnexpectedOplogEntry `WorkerExecutorError::UnexpectedOplogEntry` now carries a `ReplayDivergence`: the oplog index of the first divergence, the expected and the actual step, and the mismatched identity fields of a host call. Every producer gives the index of the entry that it names. A missing `Start` names the first entry that the claiming owner would consume next, or the end of the recorded history. A `Start` with the same invocation ID and a different identity names that `Start` and lists the fields that differ. The expected step is the recorded history and the actual step is what the replay did. A producer that compares a replayed action with a recorded entry puts the recorded entry in `expected`. A read past the end of the history gives `EndOfHistory` as the expected step, and a read at the invocation boundary gives `InvocationEnd` as the actual step. Producers that check an invariant of the recorded history alone keep their texts. Unclosed abandoned `Start`s name the lowest open index. A claim that must find its recorded `Start` runs with strict historical admission, also in a Store that continued live locally. When the `Start` is missing, the divergence names the entry that the cursor holds, the end of the history, or the deleted-region `Start` at its own index, with the claimed call as the actual step. The gRPC form keeps the structure. A request that has no protobuf form is left out of its own host call; the other request stays. The text form starts with "Unexpected oplog entry at <index>".

Commit:ba7464f
Author:Simon Schenk
Committer:Simon Schenk

Add the replay divergence and update failure class types ReplayDivergence names the first oplog index at which a replay left the recorded history, the recorded step there and the step that the replay took instead. UpdateFailureClass says why an update failed. Both have a serde, OpenAPI, desert and protobuf form. Two host calls compare their requests by schema graph and by the bits of their float leaves, so the equality stays reflexive for a request that holds a NaN.

Commit:3218942
Author:Daniel Vigovszky

Merge main and fix GC fixture CI checks Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com>

Commit:910cbf5
Author:Simon Schenk
Committer:Simon Schenk

Stop oplog search and agent listing at a scan budget An oplog search and an agent listing scan storage until they fill a page. A rare match or a large count made one call scan the whole oplog or every agent of the component. A call now stops when it has scanned `limits.scan_budget.entries` entries (default 100,000) or run for `limits.scan_budget.time` (default 5s), and returns a partial page with a cursor. The caller continues with the cursor. The CLI follows cursors until the end, so it still reads every entry and every agent. The search counts every oplog entry that it reads, matching or not, and reads at least one chunk per call, so each call makes progress. The guest `search-oplog` iterator uses the same budget. The agent listing scans in batches of `limits.agent_scan_batch_size` agents (default 100) and checks the budget between batches. Each `get-next` call of a guest search adds entries to the oplog of the caller. With a small budget, a search of its own oplog that read up to the current end on every call never reached it. The first batch of a guest search now fixes the last entry that the search reads. The `GolemApiOplogChunk` response records it, so replay restores it. A `get-oplog` read keeps following the end of the oplog: it reads a page of 100 entries per call, which is more than one call adds. An oplog page now has a cursor if and only if the oplog has entries after the page. Before, an empty page had no cursor, so a search that the budget stopped before a match looked like the end of the oplog. A cursor that points past the last entry of the oplog is stale. The executor refuses it with the new `WorkerExecutorError::StaleCursor`, which crosses gRPC as the `stale_cursor` case of `WorkerExecutionError`, and the worker service returns it as 400 Bad Request with the code `STALE_CURSOR`, so a client can tell it from other bad input and start again without a cursor. The revision in the cursor is not checked, because that would scan the oplog from its start on every page. A page count of 0 is refused, because its cursor would never move. The oplog viewer of `golem agent oplog --serve`/`--html` and the executor test DSL follow a cursor past an empty page. The DSL no longer reads a trailing empty page, so it reads the oplog sooner. The P3 socket snapshot test read its baseline as soon as the initialization snapshot existed, before the snapshot of its `received` call, and now often failed. It now waits for a snapshot after the start of that call.

Commit:f8236ab
Author:Simon Schenk
Committer:Simon Schenk

Tie an oplog cursor to the query of its pages A search cursor held only the next oplog index and the component revision. A caller could continue it with another query, or with a read without a query, and the results changed without an error. `OplogCursor` now also holds `query_hash`: the first 8 bytes of the SHA-256 of the search query as the caller sent it, in lowercase hex. The cursor of a read without a query has an empty hash. The string form of the cursor is `<index>-<revision>-<query hash>`, and the old form without a hash is invalid. The executor refuses a cursor whose hash is not the hash of the query of the read, before it reads the oplog. `WorkerExecutorError::StaleCursor` now has a reason: `PastEnd`, with the last index of the oplog, or `QueryMismatch`. The reason crosses gRPC as a oneof of the `StaleCursor` message. The REST API returns both reasons with the code `STALE_CURSOR`, and the error text tells them apart. The oplog viewer of `golem agent oplog --serve` sends the hash back with the cursor.

Commit:6a5d90a
Author:Daniel Vigovszky
Committer:GitHub

GOL-1050: Keep method failures local to their invocation (#4419) * GOL-1050: Keep method failures local to their invocation Record invocation-local terminals and preserve durable agent execution across method errors. Validate the same outcome during replay and normalize only SDK handler failures. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 Co-authored-by: Amp <amp@ampcode.com> * Fix invocation-local failure review findings Settle active tail work before publishing failed stream exports. Finish invocation-owned OTLP spans and duration at local failure. Update Scala ownership assertions for the handler failure wrapper. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 Co-authored-by: Amp <amp@ampcode.com> * Fix invocation failure lint and fatal-control ordering Copy invocation IDs at streaming failure boundaries. Observe constructor failure before submitting the fatal-control method instead of holding the Started append gate across admission. Preserve the failure diagnostics, warm and cold rejection, and durable fatal-state assertions. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 Co-authored-by: Amp <amp@ampcode.com> * Use a dedicated invocation failure terminal and consolidate settlement Represent method failures with AgentInvocationFailed and synchronize replay, public output, telemetry, and SDK bindings. Share live and incomplete-replay settlement, including streaming-session failure and recovery backoff reset. Recheck fatal agent health at serialized invocation admission so an acquired worker cannot accept new work after its constructor fails. Cover warm and cold admission alongside the existing method-failure runtime controls. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 Co-authored-by: Amp <amp@ampcode.com> * Fix invocation-local failure CI integration after main merge Handle AgentInvocationFailed in the oplog obfuscator using the existing privacy rules. Align archive/reload test requests with stream route scopes and remove a redundant settlement borrow. Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 Co-authored-by: Amp <amp@ampcode.com> * Coordinate recovery admission and correct fatal-failure controls Wait for a pending recovery attempt before refusing a new invocation against its previous recovery failure. Keep constructor failure checks serialized with admission. Use an explicit trap in the fatal-revert CLI fixture and observe raw-router cancellation without collecting its streaming oplog. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 * Fix fatal agent stream errors with fragmented handshake bodies Amp-Thread-ID: https://ampcode.com/threads/T-01a1cb4a-7796-749d-98fd-01ce9b0364f9 Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>

Commit:447bd0f
Author:Aditya Salunkhe
Committer:Aditya Salunkhe

Reserve the old principal field names in the protobuf messages that now carry a caller

Commit:92cb24c
Author:Daniel Vigovszky

Merge main into gol-1047-wasm-gc-exceptions Amp-Thread-ID: https://ampcode.com/threads/T-01a1c954-9cfd-7149-b7b3-7144135492ba Co-authored-by: Amp <amp@ampcode.com>

Commit:870badc
Author:Simon Schenk
Committer:Simon Schenk

Report the Sandboxed status for a never-live agent AgentStatus gets Sandboxed as its last variant: proto value 7, WIT sandboxed, the OpenAPI enum and every SDK binding. The status fold never writes it. AgentStatusRecord::reported_status() gives Sandboxed when the never-live mark is set and the folded status otherwise, and underlying_status() gives the folded status of a marked agent. Every outward view reads the reported status: the filter's status leaf, so `status = sandboxed` finds a marked agent; the guest projection AgentMetadataForGuests, which feeds the guest's metadata and enumeration; the running fast path of enumeration; the enumeration fallback for an agent whose status cannot be rebuilt, which starts from the metadata of its Create entry; the status metrics; and the executor gRPC metadata and the plugin metadata. AgentMetadataDto and the proto AgentMetadata (field 23) carry underlying_status, set only when the status is Sandboxed. Control code keeps deciding by the folded status. The exhaustive matches on it get an explicit Sandboxed arm that refuses: an interrupt and an automatic update are ignored, a resume is rejected, and a promise does not activate the agent. The CLI shows "Sandboxed (replayed state: X)" in `agent get`, colours the status, and `agent ssh` refuses a sandboxed agent with its own message. An executor test checks after a real restart that an ordinary agent's Create entry has no mark and that its metadata has no underlying status.

Commit:bb63b35
Author:Simon Schenk
Committer:Simon Schenk

Store the never-live mark in the Create entry CreateParameters gets never_live, next to create_request. Agent creation writes false, and nothing sets true yet. The mark goes through the desert form, the raw and public protos, the Create projection, the public oplog and the WIT create-parameters and raw-create-parameters, the SDK bindings that carry them, and the hand-written oplog wrappers of the Scala and TypeScript SDKs. The status fold copies the mark from Create into AgentStatusRecord and keeps it through later folds. The delivery snapshot that an oplog processor receives keeps it too. The CLI oplog view shows it on a marked Create entry, and the oplog export obfuscator keeps it.

Commit:885720c
Author:Simon Schenk
Committer:Simon Schenk

Record the failure class and the divergence on FailedUpdate `FailedUpdate` carries a required `failure_class` and an optional `divergence`, in the raw and the public oplog, in the agent status, in the update records of the agent metadata, in gRPC and in WIT. The start outcome table sets the class from the problem of the failed start, and a replay that failed at a recorded entry gives its divergence. Cancellations by a fork and failures of a manual update before its replay have the class `Other`. The raw entry does not keep the request of the expected call, because the recorded `Start` at the index holds it. The public oplog and the agent metadata read it from that `Start` and project it like the request of a public `Start`. Responses to external callers redact the host-managed values in both requests of the divergence, in the public oplog and in the agent metadata, as they do for the request of a public `Start`.

Commit:2456b19
Author:Simon Schenk
Committer:Simon Schenk

Carry a structured divergence with an oplog index in UnexpectedOplogEntry `WorkerExecutorError::UnexpectedOplogEntry` now carries a `ReplayDivergence`: the oplog index of the first divergence, the expected and the actual step, and the mismatched identity fields of a host call. Every producer gives the index of the entry that it names. A missing `Start` names the first entry that the claiming owner would consume next, or the end of the recorded history. A `Start` with the same invocation ID and a different identity names that `Start` and lists the fields that differ. The expected step is the recorded history and the actual step is what the replay did. A producer that compares a replayed action with a recorded entry puts the recorded entry in `expected`. A read past the end of the history gives `EndOfHistory` as the expected step, and a read at the invocation boundary gives `InvocationEnd` as the actual step. Producers that check an invariant of the recorded history alone keep their texts. Unclosed abandoned `Start`s name the lowest open index. A claim that must find its recorded `Start` runs with strict historical admission, also in a Store that continued live locally. When the `Start` is missing, the divergence names the entry that the cursor holds, the end of the history, or the deleted-region `Start` at its own index, with the claimed call as the actual step. The gRPC form keeps the structure. A request that has no protobuf form is left out of its own host call; the other request stays. The text form starts with "Unexpected oplog entry at <index>".

Commit:9339a21
Author:Simon Schenk
Committer:Simon Schenk

Add the replay divergence and update failure class types ReplayDivergence names the first oplog index at which a replay left the recorded history, the recorded step there and the step that the replay took instead. UpdateFailureClass says why an update failed. Both have a serde, OpenAPI, desert and protobuf form. Two host calls compare their requests by schema graph and by the bits of their float leaves, so the equality stays reflexive for a request that holds a NaN.

Commit:0a821ed
Author:Simon Schenk
Committer:Simon Schenk

Stop oplog search and agent listing at a scan budget An oplog search and an agent listing scan storage until they fill a page. A rare match or a large count made one call scan the whole oplog or every agent of the component. A call now stops when it has scanned `limits.scan_budget.entries` entries (default 100,000) or run for `limits.scan_budget.time` (default 5s), and returns a partial page with a cursor. The caller continues with the cursor. The CLI follows cursors until the end, so it still reads every entry and every agent. The search counts every oplog entry that it reads, matching or not, and reads at least one chunk per call, so each call makes progress. The guest `search-oplog` iterator uses the same budget. The agent listing scans in batches of `limits.agent_scan_batch_size` agents (default 100) and checks the budget between batches. Each `get-next` call of a guest search adds entries to the oplog of the caller. With a small budget, a search of its own oplog that read up to the current end on every call never reached it. The first batch of a guest search now fixes the last entry that the search reads. The `GolemApiOplogChunk` response records it, so replay restores it. A `get-oplog` read keeps following the end of the oplog: it reads a page of 100 entries per call, which is more than one call adds. An oplog page now has a cursor if and only if the oplog has entries after the page. Before, an empty page had no cursor, so a search that the budget stopped before a match looked like the end of the oplog. A cursor that points past the last entry of the oplog is stale. The executor refuses it with the new `WorkerExecutorError::StaleCursor`, which crosses gRPC as the `stale_cursor` case of `WorkerExecutionError`, and the worker service returns it as 400 Bad Request with the code `STALE_CURSOR`, so a client can tell it from other bad input and start again without a cursor. The revision in the cursor is not checked, because that would scan the oplog from its start on every page. A page count of 0 is refused, because its cursor would never move. The oplog viewer of `golem agent oplog --serve`/`--html` and the executor test DSL follow a cursor past an empty page. The DSL no longer reads a trailing empty page, so it reads the oplog sooner. The P3 socket snapshot test read its baseline as soon as the initialization snapshot existed, before the snapshot of its `received` call, and now often failed. It now waits for a snapshot after the start of that call.

Commit:5bae88f
Author:Simon Schenk
Committer:Simon Schenk

Tie an oplog cursor to the query of its pages A search cursor held only the next oplog index and the component revision. A caller could continue it with another query, or with a read without a query, and the results changed without an error. `OplogCursor` now also holds `query_hash`: the first 8 bytes of the SHA-256 of the search query as the caller sent it, in lowercase hex. The cursor of a read without a query has an empty hash. The string form of the cursor is `<index>-<revision>-<query hash>`, and the old form without a hash is invalid. The executor refuses a cursor whose hash is not the hash of the query of the read, before it reads the oplog. `WorkerExecutorError::StaleCursor` now has a reason: `PastEnd`, with the last index of the oplog, or `QueryMismatch`. The reason crosses gRPC as a oneof of the `StaleCursor` message. The REST API returns both reasons with the code `STALE_CURSOR`, and the error text tells them apart. The oplog viewer of `golem agent oplog --serve` sends the hash back with the cursor.

Commit:075f6e4
Author:Aditya Salunkhe

Merge upstream main

Commit:695b245
Author:Dávid István Bíró

Carry static config defaults through owner metadata [skip ci]