ceilf6 / ceilf6/FrontAgent

[Bug] decideFilesense gates navigation on keyword regexes, so paraphrasing the same question disables it

Open
#425 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
119
Forks
19
PR merge metrics
No merged PRs in 30d

Description

What

trigger-policy.ts decides whether a query task needs directory navigation by regex-matching the task text:

function taskMentionsStructureNeed(task: AgentTask): boolean {
  const text = task.description.toLowerCase();
  return /architecture|structure|overview|map|架构|结构|目录|模块|梳理|理解/.test(text);
}

Ask the same question in different words and navigation does not fire.

Observed

Two phrasings of the same question, same fixture, same arm:

task text navigated result
说明 src 下四个顶层目录各自的职责,以及一个 feature 目录内部的分层约定 yes (271 entries) FAIL
这个代码库按什么原则分层?说明各层之间允许的依赖方向,以及一个业务域内部是怎么组织的 no FAIL

The second run: 7 LLM calls, 263s, one executed step, filesense: [], and an answer of "I have no evidence about this codebase's layering". A question about layering and dependency direction plainly needs to look at the directory tree; none of 架构 / 结构 / 目录 / 模块 / 梳理 / 理解 appears in it, so the gate never opened.

Why it matters

The gate is meant to keep navigation off tasks that do not need it — a reasonable goal, since scanning costs tokens. But keyword matching makes the decision depend on vocabulary rather than need. A user who says "分层" instead of "结构", or "how is this organised" instead of "structure", silently gets a worse agent.

It also distorts measurement: an ablation comparing arms cannot attribute a difference to navigation quality when navigation fires for one phrasing and not another. I hit this while rewriting the ablation task set to remove location hints from the prompts (#422 follow-up) — removing the hints also removed the trigger words, which is not a distinction the user would expect to be making.

Suggested direction

The task type and the plan already carry the signal that the regex is trying to recover. A query whose plan contains search_code / list_directory steps is, by construction, a query that needs to locate something. Deciding from the plan shape rather than from the prompt's vocabulary would be both more robust and cheaper to reason about.

If a text signal is kept, it should at least be a fallback rather than the gate, and the current 10-alternative Chinese/English list is not a maintainable way to express "this question is about where things live".

Related

Found while running the filesense ablation. Same family as #419 (query never planned at all) and #420 (bare focus-dir names as scan roots): the capability is fine, the conditions under which it is invoked are not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in trigger-policy.ts and trace how the plan represents search_code and list_directory steps. Reproduce the two task phrasings from the issue, then verify that navigation is selected from the plan shape rather than only the text regex. Done means paraphrased structure questions receive the needed navigation without enabling it for tasks that do not need it.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.