Agent files: wire CPT contents into the runtime system prompt#74
Open
lezama wants to merge 1 commit into
Open
Conversation
The `openclawp_agent_file` CPT shipped in #71 was authored but never read by the runner. Append the per-agent file set (globals + agent-targeted) to the agent's static description before passing it to `using_system_instruction()`. - New `OpenclaWP_Agent_Files_Store::for_agent_as_text( $agent_slug )` concatenates the matching files as `=== title ===\nbody\n…` plain text. - New `openclawp_runner_system_instruction` filter lets other plugins layer in further per-turn customisation after agent files are merged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <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.
Summary
Wires
openclawp_agent_fileCPT contents (shipped in PR #71) into the runtime system prompt assembler. The runner now reads files targeted at the current agent (own + globals) and appends them to the agent's static description before passing it towp_ai_client_prompt()->using_system_instruction().OpenclaWP_Agent_Files_Store::for_agent_as_text( $agent_slug )returns the files concatenated as plain text (=== title ===\nbody\n…).openclawp_runner_system_instructionfilter lets other plugins layer in further per-turn customisation.Why
PR #71 shipped the CPT + admin UI but the contents didn't reach the runtime — admins could author files but the agent ignored them. This PR closes that loop.
Test plan
AGENTS.mdwithagent_slug = ''and body "Always reply in upper-case." — every agent turn now sees it.🤖 Generated with Claude Code