Using oduit from a coding agent
oduit agent ... is the primary documented automation surface for external
coding agents. Prefer it over the Python API for editor agents, bots, and
other out-of-process automation.
This page is the single source of truth for:
command sequence
mutation policy
payload expectations
failure handling
Command Families
Default to the read-only inspection and planning commands:
contextinspect-addon,inspect-addons, andaddon-docplan-updatepreflight-addon-changeprepare-addon-changelocate-modelandlocate-fieldlist-addon-tests,recommend-tests, andlist-addon-modelsfind-model-extensionsandget-model-viewsdoctor,list-addons,dependency-graph,explain-install-order,resolve-config,resolve-addon-root,get-addon-files,check-addons-installed,check-model-exists,check-field-exists, andlist-duplicatesdirect parity wrappers when exact runtime / DB metadata is needed:
inspect-ref,inspect-modules,inspect-subtypes,inspect-model,inspect-field,db-table,db-column,db-constraints,db-tables,db-m2m,performance-slow-queries,performance-table-scans,performance-indexes,manifest-check, andmanifest-showquery-model,read-record,search-count, andget-model-fields
Only mutate through the controlled mutation commands:
install-moduleuninstall-moduleupdate-modulecreate-addonexport-langtest-summary
For split addon technical documentation, use:
technical-evidence(beta_for_agents,controlled_source_mutation)technical-report(beta_for_agents,controlled_source_mutation)technical-doc-diff(beta_for_agents,safe_read_only)technical-doc-refresh(beta_for_agents,controlled_source_mutation)technical-doc-accept(beta_for_agents,controlled_source_mutation)technical-doc-check(beta_for_agents,safe_read_only)technical-doc-next(beta_for_agents,safe_read_only)technical-doc-status(beta_for_agents,safe_read_only)
Recommended Command Sequence
For a change like “add email3 to res.partner in my_partner”, use
this loop:
Resolve the environment and confirm addon discovery.
oduit --env dev agent context oduit --env dev agent inspect-addon my_partner oduit --env dev agent addon-doc my_partner
Inspect the model from the database and the addon source tree.
oduit --env dev agent get-model-fields res.partner --attributes string,type,required oduit --env dev agent get-model-views res.partner --types form,tree --summary oduit --env dev agent locate-model res.partner --module my_partner oduit --env dev agent locate-field res.partner email3 --module my_partner oduit --env dev agent list-addon-tests my_partner --model res.partner --field email3
Use
list-addon-modelsorfind-model-extensionswhen the owning addon or the cross-addon extension surface is still unclear.Plan the mutation before changing anything.
oduit --env dev agent plan-update my_partner
Or bundle the common read-only planning context into one payload:
oduit --env dev agent prepare-addon-change my_partner --model res.partner --field email3 --types form,tree
After editing specific files, map them back to focused tests:
oduit --env dev agent recommend-tests --module my_partner --paths models/res_partner.py,views/res_partner_views.xml
Apply the mutation explicitly.
oduit --env dev agent update-module my_partner --allow-mutation
Verify the result with targeted tests.
oduit --env dev agent test-summary --module my_partner --test-tags /my_partner
For runtime spot checks after a change, prefer query-model, read-record,
and search-count over arbitrary code execution.
When an agent needs direct parity with the human inspection / DB / manifest commands, use the structured wrappers instead of shell snippets:
oduit --env dev agent inspect-ref base.action_partner_form
oduit --env dev agent inspect-cron base.ir_cron_autovacuum
oduit --env dev agent inspect-model res.partner
oduit --env dev agent inspect-field res.partner email --with-db
oduit --env dev agent db-table res_partner
oduit --env dev agent manifest-check sale
oduit --env dev agent explain-install-order --modules sale
For a cheap read-only planning and health pass before mutating an addon, use
preflight-addon-change:
oduit --env dev agent preflight-addon-change my_partner --model res.partner --field email3
For a single end-to-end runtime verification pass after editing one addon, use
validate-addon-change:
oduit --env dev agent validate-addon-change my_partner --allow-mutation --update --discover-tests
This command inspects the addon, checks environment health and duplicate names,
optionally installs or updates the addon, runs the full module test suite using
/<module> test tags by default, and returns one aggregate payload with
sub-results for each step.
Mutation Policy
Default to read-only commands.
install-module,uninstall-module,update-module,create-addon, andexport-langare controlled mutations.inspect-cronis read-only by default;inspect-cron --triggerbecomes a controlled runtime mutation and may require--allow-mutation.Runtime DB mutation uses explicit flags:
write_protect_dbblocks runtime DB mutation for every callerneeds_mutation_flagrequires--allow-mutationfor human runtime DB mutationagent_write_protect_dbblocks runtime DB mutation for agent commandsagent_needs_mutation_flagrequires--allow-mutationfor agent runtime DB mutation
Controlled source mutations still require
--allow-mutationregardless of runtime DB policy flags.uninstall-modulealso requires--allow-uninstallandallow_uninstall = truein the active environment config.--dry-runis supported byinstall-module,uninstall-module,update-module,create-addon, andexport-lang. Their dry runs return read-only planning payloads.test-summarystays read-only unless you pass--installor--update.validate-addon-changeonly consults runtime DB mutation policy when you request install or update work.If
context,resolve-config, orlist-duplicatesreports blockers, fix them before mutating.Do not use
execute_python_code()orOdooCodeExecutorfor routine coding-agent automation. Reserve them for trusted operator-controlled paths.
Payload Expectations
Every final-result agent command emits exactly one JSON object on stdout.
Raw command metadata is hidden by default; opt in with
oduit agent --show-command ... when data.command is needed for
debugging.
Guaranteed top-level keys:
schema_versiontypesuccessread_onlysafety_levelwarningserrorsremediationdatameta
When available, commands also include:
operationerrorerror_typeerror_code
data is the canonical command payload container:
command-specific fields such as
module,count, orcandidateslive underdatameta.timestampis the canonical payload creation timemeta.durationremains optional when timing data is availabletop-level timestamp aliases are not part of the agent contract
When --show-command is enabled, the raw command is exposed as
data.command.
Technical-documentation payload notes:
preview payloads include
would_write,would_write_metadata, andpreview--include-markdownis opt-in for full markdown output in agent payloadswrite commands return relative output paths for changed files
technical-doc-check,technical-doc-status, andtechnical-doc-nextdefault to compact file listings unless--include-filesis passedfinal payload JSON stays on stdout; progress output remains on stderr
For source-location commands, prefer explicit decision fields over raw confidence alone:
data.resolution: overall result such asconfirmed,ambiguous,suggested, ornot_founddata.ambiguous/data.ambiguity_reason: whether the command found multiple plausible matchesdata.candidates[*].match_strengthanddata.candidates[*].evidence: why a candidate was chosen and whether it is a confirmed source hit or a best-effort suggestion
Compatibility Policy
additive fields are allowed within
schema_version = 2.xconsumers must read command-specific data from
payload["data"]meta.timestampis the canonical creation timestampflattened command-field aliases and
generated_atare not part of the supported agent contract
Payload Stability Tiers
- stable:
schema_version,type,operation,success, read_only,safety_level,warnings,errors,remediation,error,error_type,error_code,data,meta
- stable:
soft-stable: optional debug metadata such as
data.commandand optional timing data such asmeta.durationexperimental: newly introduced command-specific fields inside
datathat are not yet called out in the public docs
Command Stability Tiers
Use Agent command inventory for the generated command-by-command tier matrix.
stable_for_agents: recommended machine-facing surface for coding agentsbeta_for_agents: useful for agents but still evolving in behavior, heuristics, or workflow shapehuman_oriented: supported CLI surface documented primarily for humanscompatibility_only: retained for migration or import compatibility only
Safety Levels
safe_read_only: inspection and analysis onlycontrolled_runtime_mutation: explicit commands that mutate database, process, or runtime state, gated by flags such as--allow-mutationcontrolled_source_mutation: explicit commands that write or rewrite addon source files, also gated by flags such as--allow-mutationunsafe_arbitrary_execution: trusted arbitrary code execution only
Published Schemas
Published JSON Schema artifacts live under schemas/:
schemas/result-envelope.schema.jsonschemas/agent/environment-context.schema.jsonschemas/agent/addon-info.schema.jsonschemas/agent/addon-documentation.schema.jsonschemas/agent/addon-inspection.schema.jsonschemas/agent/update-plan.schema.jsonschemas/agent/query-result.schema.jsonschemas/agent/model-source-location.schema.jsonschemas/agent/field-source-location.schema.jsonschemas/agent/addon-test-inventory.schema.jsonschemas/agent/addon-model-inventory.schema.jsonschemas/agent/model-extension-inventory.schema.jsonschemas/agent/model-view-inventory.schema.jsonschemas/agent/addon-root-resolution.schema.jsonschemas/agent/addon-file-inventory.schema.jsonschemas/agent/addon-install-checks.schema.jsonschemas/agent/model-existence.schema.jsonschemas/agent/field-existence.schema.jsonschemas/agent/addon-change-preflight.schema.jsonschemas/agent/addon-change-validation.schema.jsonschemas/agent/addon-change-context.schema.jsonschemas/agent/recommended-test-plan.schema.jsonschemas/agent/xmlid-inspection.schema.jsonschemas/agent/cron-inspection.schema.jsonschemas/agent/module-inspection.schema.jsonschemas/agent/subtype-inventory.schema.jsonschemas/agent/model-inspection.schema.jsonschemas/agent/field-inspection.schema.jsonschemas/agent/table-description.schema.jsonschemas/agent/column-description.schema.jsonschemas/agent/constraint-inventory.schema.jsonschemas/agent/table-inventory.schema.jsonschemas/agent/m2m-inspection.schema.jsonschemas/agent/slow-query-metrics.schema.jsonschemas/agent/table-scan-metrics.schema.jsonschemas/agent/index-usage-metrics.schema.jsonschemas/agent/manifest-validation.schema.jsonschemas/agent/manifest.schema.json
Failure Handling
Always read both the process exit status and the payload
successflag.Failure payloads still use the same JSON envelope and are emitted before the command exits non-zero.
Prefer
errorfor the human-readable summary.Prefer
error_typefor the stable failure category.Prefer
error_codefor the stable machine-branching key.Prefer
errorsfor structured details.Prefer
remediationfor next actions the caller can take.ConfirmationRequiredmeans a controlled runtime or source mutation was attempted without--allow-mutation.ConfigErrorusually means the environment config, resolved binaries, oraddons_pathneeds to be fixed before retrying.ModuleNotFoundErrormeans the requested addon was not resolved in the activeaddons_path.ValidationErrormeans an input format such as--domain-jsonor a repeated filter option could not be parsed safely.
Example failure codes:
config.addons_path_missingmodule.not_foundmutation.confirmation_requiredruntime.test_failureruntime.install_dependency_errorruntime.uninstall_dependency_blocked
When success = false, do not guess about the next step. Inspect the
structured payload, follow remediation, reconcile state if needed, and then
rerun the next targeted command.
Example
{
"schema_version": "2.0",
"type": "model_source_location",
"success": true,
"operation": "locate_model",
"read_only": true,
"safety_level": "safe_read_only",
"warnings": [],
"errors": [],
"remediation": [],
"data": {
"model": "res.partner",
"module": "my_partner",
"addon_root": "/workspace/addons/my_partner",
"resolution": "confirmed",
"ambiguous": false,
"candidates": [
{
"path": "/workspace/addons/my_partner/models/res_partner.py",
"class_name": "ResPartner",
"match_kind": "inherit",
"declared_model": "res.partner",
"confidence": 0.98,
"match_strength": "confirmed",
"evidence": [
{
"kind": "model_inherit",
"message": "Class inherits `res.partner` directly in addon source.",
"path": "/workspace/addons/my_partner/models/res_partner.py",
"line_hint": 6
}
],
"line_hint": 6
}
]
},
"meta": {
"timestamp": "2026-04-09T12:00:00"
}
}