Skip to content

The task procedures are not among the skills retrieved for a task request: find where retrieval loses them #3810

Closed

Description

@malibio

Overview

For the task requests in eval:tasks, neither Creating a Task nor Answering a Question is among the candidate skills the model is shown. The prompt dump of the Stage 2 turn shows other skills, so the question is whether the retrieval path (Stage 1 query, skill search, candidate selection and injection) is flawed, and where it loses the procedure.

Problem Statement

Captured with NODESPACE_PROMPT_DUMP on main, E4B, one rep of bug-created-ready and question-blocks-task:

bug-created-ready question-blocks-task
User request "Something is off in Query engine rewrite: Cut the release branch is marked done but one box on its checklist is still unticked. Get that tracked as work." a question that stops the migration-guide task, waiting on a person
Stage 1 route_query the model emitted "mark checklist item as work for Query engine rewrite release branch that is marked done but has an unticked box on its checklist" "put Anoop's question down to wait for him regarding v1 export format or only v2 coverage of the migration guide"
Candidates in the Stage 2 prompt Graph Editing, Schema Creation, Play Workflow State, Node Creation, Completing a Task Bulk Import, Schema Creation, Organization, Building and Changing a View
Creating a Task / Answering a Question in the prompt 0 occurrences 0 occurrences

What follows from the dump:

  • The verbs that name the procedure are gone before retrieval. "Get that tracked as work" became "mark checklist item as work", which matches Graph Editing's own purpose line (mark a record done, change a field).
  • Stage 2 is large for what it is doing. About 74k chars (36k system including nine active playbooks and a full "CREATING A SCHEMA" block, 38k for 12 tool declarations) for a request of about 150 chars, with Schema Creation a candidate in both scenarios and no schema asked for.
  • Some scenarios pass for the wrong reason. bug-not-reproducible passes when its create_node of a nonexistent type "Issue" is refused, so nothing was written.
  • The agent's behaviour follows what it was shown. It reverts the done task through update_task_status or invents a waits_for relationship, which is what the loaded skills told it to do. The earlier reading that the model is not following the procedures does not hold for these two turns: the procedures were never in front of it.

Counts on main (E4B, 3 reps with a database purge between reps): bug-created-ready 0/3, question-blocks-task 0/3, answer-asks-user 0/3, per-rep scores 2/5, 1/5, 2/5. Single rep, two scenarios dumped, one model: a lead, not a conclusion.

Proposed Solution

Find, with evidence at each hop, where the procedure drops out. Work down the path in order and stop at the first hop that loses it:

  1. The Stage 1 query. Does the paraphrase lose the intent, and is that the model's choice or something in the Stage 1 prompt (its instruction to keep the subject noun and the action, the mentioned-entity block, the examples) that pulls it toward the resolved entities?
  2. The retrieval step. For the model's query and for the user's own sentence, where do Creating a Task and Answering a Question rank, with what scores, and what do the score gate, the trust filter and K do to them? Compare how the skill's description and purpose line read against both queries.
  3. Candidate injection. What decides which candidates are injected and in what order, and does anything demote a procedure skill (role procedure) against the generic skills?
  4. The surrounding context. With the right procedure injected by hand into these two prompts, does E4B follow it? That separates a retrieval failure from a context-size failure, and says whether the nine playbooks and the schema block matter.

Answer plainly at the end whether the plumbing is flawed or the query/description wording is, since the fix differs: an ordering or gating defect is code, while a query or description defect is wording and measured against the whole confusion matrix.

Documentation

  • ADR-038 - the flow under test: the model emits a query, a system step retrieves top-K skills, then Stage 2 judges them. The model forming the query is by design, so a lossy query is a defect in how it is asked, not in the flow's shape
  • ADR-018 - the two-stage classification this runs inside
  • agent-eval.md - the dump recipe (NODESPACE_PROMPT_DUMP) and isolation with NODESPACE_HOME
  • No ADR is expected to change; if the finding is that the flow itself must change, say so in the PR and write the superseding ADR first.

Acceptance Criteria

  • For each of the five eval:tasks scenarios the hop at which the right procedure is lost is stated with evidence (the Stage 1 query, its rank and score, and what was injected)
  • It is stated whether the retrieval code (gating, ordering, injection) is at fault, or the query and description wording, or neither
  • The Stage 2 prompt is measured by section for these scenarios, and the effect of injecting the right procedure by hand is recorded
  • A fix, if one is clear, is measured against the whole skill-retrieval confusion matrix and eval:tasks over 3 reps, with eval:agent as a smoke check
  • No skill description is reworded to match an eval prompt; a wording change is justified by the cost-side controls
  • Code passes bun run quality:fix

Technical Specifications

Reference Files

  • packages/agent/src/local_agent/routing.rs - Stage 1 routing and the retrieval step
  • packages/agent/src/local_agent/agent_loop.rs - Stage 1 system prompt and candidate injection
  • packages/agent/src/local_agent/prompt_templates.rs - the Stage 2 prompt template
  • packages/agent/src/seeds/skills/creating-a-task.md, answering-a-question.md - the procedures that were not retrieved
  • packages/agent/tests/it/skill_confusion_matrix.rs - the offline retrieval measurement
  • scripts/eval/fixtures/tasks.ts - the five scenarios

Implementation Details

  • Reproduce with the isolated-daemon recipe in agent-eval.md, NODESPACE_PROMPT_DUMP set, --only bug-created-ready,question-blocks-task. The dump holds {"kind":"prompt","sent":...} and {"kind":"response","raw_response":...} lines by seq; Stage 1 is the small prompt that ends in a route_query call.
  • Purge the database and rebuild the daemon before measuring, since seeded guidance does not update in an existing database.
  • Run nothing else on the machine's GPU during a run.

Related Issues

Non-Goals

  • Rewording Creating a Task or Answering a Question to win these prompts
  • Changing the model or the context window

Activity

  1. malibio commented on Oct 14, 2026

    @malibio
    CollaboratorAuthor

    Consolidated into #3784: its body now carries the dump evidence and the four-hop plan. Closing as a duplicate.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions