Skip to content

PFormat tool-call syntax dropped from parser while ~10 builtin prompts still teach it #4465

Description

@senamakel

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-194src/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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentBuilt-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/.bugpriority: mediumEdge case or race conditionsubtaskSubtask of a larger tracked effort.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions