Part of the v0.58.7 → HEAD TinyAgents-migration audit (see parent issue).
Problem
The legacy parser (v0.58.7 harness/engine/parser.rs) accepted PFormat positional tool calls (tool_name[arg1|arg2]). The migrated parse path (src/openhuman/tinyagents/model.rs:162-194 → src/openhuman/agent/harness/parse.rs) kept the XML/JSON/markdown/GLM grammars but dropped PFormat — while ~10 built-in agents' prompts still teach the syntax (src/openhuman/agent/harness/subagent_runner/ops/runner.rs:761 and the agent prompt files). A model that follows its own instructions emits calls that are now logged as "malformed" and silently lost — the turn continues as if no tool was called.
Fix plan
Decide one of:
- (a) Restore PFormat parsing in
parse.rs and wire it into the fallback chain in model.rs (port the legacy grammar + its tests), or
- (b) Remove PFormat from all prompts: strip the
name[a|b] teaching from the ~10 builtin agent prompts and runner.rs:761, replacing with the supported XML/JSON form.
Recommendation: (b) unless there's evidence local/small models rely on PFormat for reliability — the fewer grammars the parser speaks, the fewer ambiguity bugs; but whichever way, prompts and parser must agree.
Either way: add a lint-style test that greps builtin prompts for tool-call syntax examples and asserts the parser accepts each one (prompt/parser contract test), so drift can't recur.
Acceptance criteria
- Every tool-call syntax taught by any builtin prompt round-trips through the live parser.
- Contract test in CI.
Part of the v0.58.7 → HEAD TinyAgents-migration audit (see parent issue).
Problem
The legacy parser (
v0.58.7 harness/engine/parser.rs) accepted PFormat positional tool calls (tool_name[arg1|arg2]). The migrated parse path (src/openhuman/tinyagents/model.rs:162-194→src/openhuman/agent/harness/parse.rs) kept the XML/JSON/markdown/GLM grammars but dropped PFormat — while ~10 built-in agents' prompts still teach the syntax (src/openhuman/agent/harness/subagent_runner/ops/runner.rs:761and the agent prompt files). A model that follows its own instructions emits calls that are now logged as "malformed" and silently lost — the turn continues as if no tool was called.Fix plan
Decide one of:
parse.rsand wire it into the fallback chain inmodel.rs(port the legacy grammar + its tests), orname[a|b]teaching from the ~10 builtin agent prompts andrunner.rs:761, replacing with the supported XML/JSON form.Recommendation: (b) unless there's evidence local/small models rely on PFormat for reliability — the fewer grammars the parser speaks, the fewer ambiguity bugs; but whichever way, prompts and parser must agree.
Either way: add a lint-style test that greps builtin prompts for tool-call syntax examples and asserts the parser accepts each one (prompt/parser contract test), so drift can't recur.
Acceptance criteria