Skip to content

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

Closed

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-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.

Activity

  1. added
    subtaskSubtask of a larger tracked effort.
    agentBuilt-in agents, prompts, orchestration, and agent runtime in src/openhuman/agent/.
    on Jul 3, 2026
  2. M3gA-Mind commented on Jul 7, 2026

    @M3gA-Mind
    Collaborator

    Resolved by merged PR #4495 ("TinyAgents migration parity & bug fixes (#4451–#4469)") + follow-up #4504 — both present in main. Part of the completed #4470 cluster; closing as done. (Reopen if a residual remains.)

  3. added theissue type on Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions