Repository navigation
Conversation
noise64
force-pushed
the
python-agents
branch
2 times, most recently
from
November 17, 2026 00:55
7412be7 to
8db2927
Compare
noise64
force-pushed
the
python-runtime
branch
from
November 17, 2026 01:11
966533d to
64182c6
Compare
noise64
force-pushed
the
python-agents
branch
from
November 17, 2026 01:11
8db2927 to
1284a7e
Compare
This was referenced Nov 17, 2026
noise64
force-pushed
the
python-agents
branch
from
November 18, 2026 12:47
1284a7e to
da2dd66
Compare
noise64
force-pushed
the
python-runtime
branch
from
November 18, 2026 12:47
64182c6 to
1a0fc47
Compare
noise64
force-pushed
the
python-agents
branch
from
November 18, 2026 23:58
da2dd66 to
9503f7d
Compare
noise64
force-pushed
the
python-runtime
branch
from
November 18, 2026 23:58
1a0fc47 to
1ce8942
Compare
noise64
force-pushed
the
python-agents
branch
from
November 20, 2026 13:38
9503f7d to
e81883f
Compare
noise64
force-pushed
the
python-runtime
branch
from
November 20, 2026 13:38
1ce8942 to
52f5fc9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of GOL-1851. Stacked on #4516 (PY-02). PY-04 and PY-05 come next.
This PR adds agent declarations and method dispatch to the Python SDK. Methods are synchronous, and parameters and results have primitive types.
@agentand@methodonly record the class or the function and its file and line. They construct nothing. After pre-initialization imports every entry module, the bootstrap finalizes the registry. Finalization resolves the annotations in their defining scopes, so an annotation can name a type that the module defines later. It makes one declaration per agent type. Discovery and the argument and result checks use the same declaration.Annotated[int, ...], class annotations that fail to evaluate, a first parameter that is not positional (the method needs it for the instance), async or generator methods, default, variadic and keyword-only parameters,config, duplicate type names,@methodoutside an@agentclass, and@methodon__init__, astaticmethodor aclassmethod. The error reaches the build through the stderr capture from Build Python components from prepared runtime assets #4516. A structured, bounded diagnostic channel is not part of this PR.bool,int(s64),float(f64),str,bytes(binary) andNone(unit output).boolis not anint, andintis not afloat. Anintresult outside thes64range is an error, becauses64is the defaultintschema.__init__. An instance initializes one agent, once. A secondinitializefails and keeps the agent and its state. Only decorated methods are exported.invalid-inputand change no state. An unknown type givesinvalid-type, and an unknown method givesinvalid-method. An exception from the constructor or a method gives acustom-errorwith a string payload, as the TypeScript SDK does. A result of the wrong type also gives acustom-error, but the method already ran, so its effects stay. Retry is not safe in that case.The native tests in
sdks/python/testscheck declarations and dispatch without Wasm. The tests ingolem-python-assembler/tests/assemble.rsbuild actual components from the prepared assets and run discovery, initialization and invocation on the shared engine. They use a statefulCounterwith unequal updates, boths64bounds, bool-versus-int inputs, and malformed inputs that would change the state if they reached the method. Golem CI does not run these integration tests yet, because they need the prepared assets.Not in this PR: async methods, compound types, config, descriptions, HTTP mounts and declared errors (later SDK issues); the wheel (PY-04); CLI build, deploy and reconstruction (PY-05).
Verification
This head, cc279c3, merges the new #4516 head into the previous head 7d1342c. This layer has no other change. Checks on this head:
python -I -m unittest discover -s testsinsdks/python, on native CPython 3.14: pass.cargo test -p golem-python-assembler --testsand--doc,cargo clippy -p golem-python-assembler --all-targets -- -D warningsandcargo fmt -p golem-python-assembler -- --check: pass.ruff format --check: pass.ruff check: fails with the known findings BLE001 (twice, in_registry.py) and S102 (intests/test_declarations.py).CI: pull requests run no Golem tests. A missing result is not a pass.