kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

Agent resolution appears to use contextual/file heuristics instead of KiloCode config priority, causing wrong identity and availability claims

Open terry-webandwow opened this issue 7 months ago • 1 comments

Description

We ran into a reproducible but currently unexplained scenario in KiloCode and would like to understand where in the system this could originate.

This is not a blame report. We are sharing a fact-based scenario because the behavior suggests that agent/mode resolution may not consistently prioritize the actual KiloCode configuration sources.

Our current hypothesis is:

  • global and project-local KiloCode config can be resolved correctly
  • but without strict prompting, the running agent may mix those config sources with unrelated contextual artifacts
  • that leads to wrong claims about:
    • which agent is currently active
    • which agents are actually available
    • what certain modes mean

Why this looks like a system issue

In our setup, the technically relevant KiloCode config sources are:

  • global config:
    • C:\Users\terry\.config\kilo\kilo.jsonc
  • project-local config:
    • P:\projects\WEBSITES\intern\webandwow.de\.kilo\kilo.json

The currently used project-local mode was:

  • code-simplifier
  • installed from the KiloCode marketplace
  • not modified by us

Despite that, the running agent repeatedly identified itself as Wendy and made broader availability claims that did not match the actual active configuration.

Key observed facts

  1. The running agent was an unmodified marketplace mode
  • We were working in the project-local marketplace mode code-simplifier.
  • This mode was installed into:
    • P:\projects\WEBSITES\intern\webandwow.de\.kilo\kilo.json
  • It was not modified by us.
  1. The running agent misidentified itself
  • The active mode was code-simplifier.
  • The agent nevertheless claimed it was Wendy, the current live standard KiloCode agent.
  • It also claimed this identity came from its prompt/instructions, .kilo/kilo.json, model identifier, and an assumed default-mode rule.
  • It then immediately became uncertain and suggested checking the config file to see which mode was actually active.

This looked like a constructed explanation rather than real state awareness.

  1. The agent listed non-config artifacts as if they were available agents

Without strict constraints, the agent built agent lists from mixed sources such as:

  • an internal AGENTS/ folder tree
  • AgentMindHub knowledge/scenario content
  • open tabs
  • markdown files mentioning agent names
  • rules that referenced agent-related paths

This even pulled in names that were not real active KiloCode agents in the technical sense.

Example:

  • Ramon and Luci were included even though they only appeared in an example scenario used to explain another system.
  1. A rule mentioning an AGENTS/ path changed the result

We observed that when a shared rule referenced:

  • P:/core/AGENTS/<agent>/

the KiloCode agent started listing agents from that area as if they were available.

After moving that rule out of the active shared rules, those names were no longer listed.

That suggests the agent-resolution logic was influenced by a path mention inside rules, not just by active KiloCode configuration.

  1. Archie resolution used file heuristics instead of clearly starting from config

When asked who Archie is and how to access it, the agent visibly searched through:

  • *archie*.md
  • WP_archie.md
  • architect-archie.md
  • alias-like patterns
  • and a project-local .kilo/kilo.json path under the wrong project root

In that observed search flow, it did not visibly check the global config:

  • C:\Users\terry\.config\kilo\kilo.jsonc

From a system architecture perspective, that global file seems like the natural SSOT for globally defined KiloCode agents/modes.

  1. Under strict constraints, config-only resolution worked

When explicitly asked:

Name only the agents you can directly prove from active KiloCode configuration files. No docs, no hub data, no markdown heuristics.

the agent answered correctly and only returned:

  • code-simplifier

from the active project config.

This strongly suggests the problem is not that KiloCode cannot read config, but that it may over-broaden the source set unless forced not to.

Expected behavior

For questions like:

  • Which agent am I currently running?
  • Which agents are actually available?
  • Who/what is Archie in this environment?

we would expect source priority roughly like this:

  1. active project-local KiloCode config
  2. global KiloCode config
  3. UI/session state derived from those configs
  4. only then optional explanatory context

We would not expect:

  • AGENTS/ folder content
  • rules mentioning agent-like paths
  • markdown files with matching names
  • knowledge-graph examples
  • open tabs

to be used as primary evidence for active agent existence or current identity.

Actual behavior

The agent appeared to mix:

  • active config
  • contextual artifacts
  • file-name heuristics
  • rules
  • knowledge content

and then produced confident statements about:

  • the current agent identity
  • agent availability
  • mode meaning
  • activation method

even when those statements were at least partially wrong.

Questions for the KiloCode team

  1. Which part of the system is responsible for resolving current agent identity and agent availability?
  2. Is there an intended source-priority model between:
    • active project config
    • global config
    • UI/session state
    • prompt context
    • docs/rules/markdown/open tabs
  3. Should C:\Users\terry\.config\kilo\kilo.jsonc be treated as the global SSOT for globally available agents/modes?
  4. Is it expected that rules or markdown files mentioning agent names can influence agent inventory answers?
  5. Could marketplace modes inherit or hallucinate a default identity like Wendy when their own active identity is not explicitly grounded?
  6. Is there already a known bug or subsystem where config-based mode identity falls back to heuristic context reconstruction?

Minimal environment summary

  • OS: Windows
  • KiloCode used in VS Code
  • global KiloCode config present
  • project-local .kilo/kilo.json present
  • unmodified marketplace mode active in project context

Supporting evidence we can provide

We have local documentation for the scenario, including:

  • visible session agent list
  • project-local marketplace mode location
  • export/import mode format (*.agent.json)
  • observed search paths
  • message IDs showing wrong identity and availability claims
  • a control test where config-only resolution returned the correct result

If helpful, we can turn this into a smaller public repro with sanitized names and paths.

terry-webandwow avatar Apr 06 '26 11:04 terry-webandwow

To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please reopen it or create a fresh new one.

github-actions[bot] avatar Jun 13 '26 07:06 github-actions[bot]