Skip to content

fix(agent): skill prompt instructions create mandatory consultation loop and unconditional authority #85

Description

@jdmanring

Problem

Three strings in `src/agent_loop.py` instruct the agent to consult the skill registry before every task and to treat extracted skills as proven, authoritative procedures. Together they produce a mandatory pre-task consultation loop that consumes agent rounds on overhead before any user work begins.

String 1 — `manage_skills` tool description (line ~417):

"Use this BEFORE doing domain work — there may already be a procedure (published or draft) that prescribes the correct steps. Drafts written by the teacher loop are authoritative guidance even though they're not yet published."

This instructs the agent to call `manage_skills list` before starting any task. For tasks with a non-empty skill index, the agent then calls `manage_skills view` for each seemingly relevant skill — consuming 2–3 rounds before the actual work begins.

String 2 — matched-skills injection header (lines ~1274-1279):

"Each is a procedure proven to work. Follow them step by step."

Skills are LLM extractions from a 12-message context window — they are approximations, not verified facts. "Proven to work" is a false claim. "Follow them step by step" causes unconditional execution even when the skill mismatches the current task.

String 3 — skill index block header (lines ~1447-1453):

"Procedures the assistant should consult before doing domain work. [...] treat them as authoritative guidance"

Same pattern: mandatory pre-task gate + unconditional deference.

Observed behavior: The agent calls `manage_skills` at the start of nearly every session that has skills present. On tasks with a large skill index, this is 2–4 extra rounds before user work starts.

Proposed fix

`src/agent_loop.py` — 3 string replacements:

Change 1 (line 417): Replace "BEFORE doing domain work" and "authoritative guidance" with conditional language — check the registry when the domain looks familiar, treat published skills as reviewed and drafts as candidates.

Change 2 (lines 1274-1279): Replace "proven to work. Follow them step by step." with "candidate procedures. Evaluate fit — apply if relevant, use own judgment if not."

Change 3 (lines 1447-1453): Replace "consult before doing domain work" and "treat them as authoritative guidance" with "reference procedures for this session. When a task closely matches, apply; evaluate drafts before following."

Tests

New file `tests/test_agent_skill_prompt_language.py` — 6 static source-text assertions:

  1. "BEFORE doing domain work" not in agent_loop.py source
  2. "authoritative guidance" not in manage_skills tool description block
  3. "proven to work" not in agent_loop.py source
  4. "Follow them step by step" not in agent_loop.py source
  5. "consult before doing domain work" not in agent_loop.py source
  6. "treat them as authoritative" not in agent_loop.py source

Upstream relevance

ROADMAP lists "Agent prompt/context bloat" as high priority. Removing the mandatory pre-task consultation loop directly reduces per-request token overhead and agent round consumption. References upstream issue #2750 "Agent prompt token bloat: measure, slim, and modularize".

Branch: `fix/skill-agent-prompt-language` (from `upstream-mirror`)
Upstream target: `pewdiepie-archdaemon/odysseus` dev branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions