nooa-codeact-advanced
Installation
SKILL.md
Advanced CodeAct (and Predict) Tuning
The authoring basics are in nooa-agent-authoring. This skill covers the deep configuration surface, verified against strategies/codeact.py, strategies/prefill.py, strategies/predict.py, and config/.
Config plumbing rules (read first)
- Strategy constructors take
config=only:CodeActStrategy(config=CodeActConfig(...)),PredictStrategy(PredictConfig(...)). Flat kwargs (CodeActStrategy(max_iterations=10),CodeActStrategy(prefill=...)) do not exist, despite some docstring examples. - All config objects are frozen Pydantic models with
merge_with(other): only fields explicitly set onotheroverride. Configs must be freshly constructed — anything round-tripped throughmodel_dump()/model_validate()has an emptymodel_fields_setandmerge_withraises. - Truncation layers: framework default →
Agentclass kwargtruncation=→ instance kwarg →@strategy(..., truncation=...)per method.TruncationConfig.merge_withdeep-merges sub-configs field-by-field; the strategy configs merge flat.
Prefill
Before the first LLM turn, CodeAct runs up to two synthetic execute_python cells (tool-call id prefixed prefill_, execution_count=0). They cost no loop iterations, their failures are non-fatal (logged as an Error event), and any variables they define persist as live REPL locals for the model's first real turn.
- The prefill plugin (default
InspectInputsPrefill()): generates code that prints the call signature,pprint()s each parameter undertruncation.prefill_formatlimits (defaultsmax_string=2000, max_length=25, max_depth=4), auto-show()sMediaparameters for multimodal perception, and printsdoc()of a complex return type. Per-parameter limits come fromAnnotated[T, spec(max_string=..., max_length=...)]on the signature. - Pre-ellipsis code: statements between the docstring and the
...are extracted from the AST and run verbatim as the second prefill cell — with or without the plugin.