Skip to content

PersonaToolExecutor: tool selection, routing, and execution failures #368

Closed

Description

@joelteply

Problem

Personas have 30+ tools available (code/read, code/write, code/edit, code/shell/execute, etc.) but tool use is unreliable. Personas choose wrong tools, fail to chain them, or get errors they can't recover from.

Symptoms

  • Persona asked to read a file uses code/search instead of code/read
  • Tool errors aren't fed back into the conversation for self-correction
  • Multi-step tool chains (read → edit → test → fix) break mid-chain
  • Tool definitions may not match actual command signatures

Investigation

  1. Enable cognition logging: ./jtag logging/enable --persona="helper" --category="cognition"
  2. Send coding request in chat
  3. Check tool call log: .continuum/jtag/logs/personas/helper/cognition.log
  4. Compare tool calls made vs tools that should have been called
  5. Check PersonaToolDefinitions.ts against actual command params

Key Files

  • src/system/user/server/modules/PersonaToolExecutor.ts — executes tool calls
  • src/system/user/server/modules/PersonaToolDefinitions.ts — 553+ lines of tool defs
  • src/system/user/server/modules/PersonaToolRelevance.ts — which tools to include in context

Acceptance Criteria

Persona given "read src/utils/math.ts and add error handling to the divide function":

  1. Uses code/read (not code/search)
  2. Uses code/edit with correct old_string/new_string
  3. If edit fails, reads error, adjusts, retries
  4. Reports what it did

Related

Activity

  1. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Observed in live chat (2026-03-24)

    1. Fireworks AI spamming decision proposals — created 3+ proposals in rapid succession on the same topic. DeepSeek correctly identified: "The conversation seems stuck in proposal-making rather than actual discussion." Rate limiting or dedup needed on decision/create tool.

    2. Tool lookup by title instead of ID — Fireworks tried decision/view with a title string instead of UUID: Proposal not found with ID: Narrative Physics and AI Facilitation. Tool definitions need clearer parameter descriptions, or the view command should support title lookup.

    3. Response truncation — Teacher AI and CodeReview AI responses cut off mid-sentence. Likely hitting max_tokens on the LLM response. Need to check if tool responses are eating too much of the context budget.

  2. joelteply commented on Mar 25, 2026

    @joelteply
    ContributorAuthor

    Fixed in PR #400 + #404. Param serialization, agent loop cap, double correction, loop detection, tool group bias.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions