Skip to content

feat(context): announce external context directories in the turn text - #68

Open
luoxuanzao wants to merge 1 commit into
mainfrom
feat/external-context-notice
Open

luoxuanzao wants to merge 1 commit into
mainfrom
feat/external-context-notice

Conversation

@luoxuanzao

Copy link
Copy Markdown
Member

Summary

  • External context directories were invisible to the agent: the CLI's own # Environment block is not part of Qoderian's system prompt, so the extra working directories never reached the model. The message you send right after adding or removing one now carries an <external_context> tag listing the current directories.
  • The tag is appended to the user message (never the system prompt), so the prompt stays stable and the provider prefix cache is unaffected. It is sent once per change — additions, removals (rendered as (none)), and once after a session switch that never saw the current list. /compact keeps skipping context tags.
  • The tag is registered with the existing XML context envelope (XML_CONTEXT_PATTERN, extractUserQuery), so message bubbles and history show the plain user text without it.

Verification

  • npm run typecheck
  • npm run lint
  • npm run test — 165 suites / 3546 tests pass
  • npm run build
  • npm run release:check — Release 1.0.11 is ready
  • npm run audit:prod — 0 vulnerabilities
  • Real-app check in a live vault (two turns): the CLI session transcript records the <external_context> tag inside the user message and the model quotes the listed paths from it; the rendered user bubble contains no tag; a second message with an unchanged selection carries no tag

Safety

  • No credentials, private vault content, internal URLs, or personal paths are included
  • User-visible changes are documented in CHANGELOG.md

Co-authored-by: QoderAI (Qwen 3.8 Max) qoder_ai@qoder.com

The agent could not tell which external context directories were attached:
the CLI's own environment block is not part of Qoderian's system prompt, so
its list of additional working directories never reached the model. Send an
<external_context> tag with the turn text instead — appended only when the
selection changed, so the system prompt stays untouched and cache-friendly.

Announcements cover additions and removals ("(none)"), skip /compact, and
replay once after a session switch, which never saw the current directories.

Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant