feat(config): inject configurable files into the system prompt#157
Merged
PleasePrompto merged 1 commit intoJul 12, 2026
Merged
Conversation
…pend_system_prompt_files Add an opt-in append_system_prompt_files list to AgentConfig: each workspace-relative filename's contents are appended to the system prompt of agent-driven turns. Default empty list preserves current behavior, and missing/empty files are skipped silently. A shared async helper build_appended_files_block reads the files from the agent's own workspace, with a resolve()+is_relative_to path-escape guard (absolute paths, .., and workspace symlinks escaping the workspace are skipped). It returns None when nothing applies so callers leave append_system_prompt unchanged. Wired into the 8 agent-driven AgentRequest points: normal turns (_prepare_normal, every turn after mainmemory/roster), named-session flow + streaming, inter-agent injection (_inject_prompt, interagent message, retry), the task hub, and background named sessions. The task hub resolves each task's parent-agent workspace; the background observer gains a config param. MAINMEMORY injection is unchanged. The maintenance flows are intentionally excluded (no injection): heartbeat, memory flush, and memory compaction.
PleasePrompto
added a commit
that referenced
this pull request
Jul 12, 2026
Follow-up to #157: skip files over 256 KiB (the block is re-injected on every turn), add the key to docs/config.md and config.example.json. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PleasePrompto
added a commit
that referenced
this pull request
Jul 12, 2026
- cron one-shot Claude command: gate --effort on the 'default' sentinel like the -p path, instead of silently dropping an explicit 'medium' - extract TaskHub._prepare_request from _run (PLR0915 after the #157/#164 merges pushed _run past 50 statements) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PleasePrompto
added a commit
that referenced
this pull request
Jul 12, 2026
Post-merge fixes threading the Slack transport through main's newer subsystems (#164 per-session effort, #157 append_system_prompt_files, #166 topic-scoped kills, #137/#138 task changes): - Delete fork-only .github/workflows/upstream-release-watch.yml - Remove dead _is_message_addressed() in messenger/slack/bot.py - Fix trailing comma in config.example.json Slack section (invalid JSON) - Drop fork-only "ductor-slack" brand strings from en/wizard.toml - Harden _normalized_transport_list() in __main__.py: honor a non-empty transports list whenever the primary is a member (primary-first, others preserved) instead of collapsing to [primary] on any ordering mismatch, so telegram+matrix multi-transport setups are never silently dropped; add regression tests - named.py create(): keep both reasoning_effort and key params (# noqa: PLR0913, matching the codebase convention e.g. tasks/registry.py) - Update #164 create() test stubs for the new key kwarg - mypy: guard the optional slack_bolt import behind TYPE_CHECKING/else to satisfy strict no-redef - uv lock: add slack-bolt/slack-sdk (also picks up pre-existing lock drift) - ruff format integration-touched files Note: orch._sessions.list_active_for_chat() in slack/bot.py follows the existing private-access convention (telegram/startup.py does the same); no public accessor exists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Ductor already auto-appends
MAINMEMORY.mdto the system prompt (on new sessions), but there's no way to inject additional files — extra context or reference documents — that you want present on every turn. This adds a small config option to do exactly that.What it adds
append_system_prompt_files: list[str](default[]): a list of workspace-relative filenames whose contents are appended to the agent's--append-system-promptfor agent-driven turns."append_system_prompt_files": ["GLOSSARY.md", "STYLE_GUIDE.md"].MAINMEMORY.mdmechanism, but always-on.Where it injects (and where it doesn't)
Wired into the agent-driven request paths: normal chat, named sessions (sync + streaming), inter-agent messages (incl. retry), tasks, and background named sessions. Intentionally excluded from system-maintenance turns — heartbeat, memory flush, and compaction.
Safety
[]→ no change to current behavior..., and symlink escapes are ignored (resolved and checked against the workspace root).Tests
Coverage for the helper (concat / empty / missing / path-escape guards), every-turn injection (including resume), per-agent workspace resolution, and the maintenance-flow exclusions.