mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
Merge pull request #3299 from aronprins/codex/fix-ceo-instruction-relative-paths
[codex] Clarify Claude instruction sibling file base path
This commit is contained in:
commit
4477ca2a7e
2 changed files with 9 additions and 2 deletions
|
|
@ -387,7 +387,11 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
|
||||||
preparedInstructionsFile = true;
|
preparedInstructionsFile = true;
|
||||||
try {
|
try {
|
||||||
const instructionsContent = await fs.readFile(instructionsFilePath, "utf-8");
|
const instructionsContent = await fs.readFile(instructionsFilePath, "utf-8");
|
||||||
const pathDirective = `\nThe above agent instructions were loaded from ${instructionsFilePath}. Resolve any relative file references from ${instructionsFileDir}.`;
|
const pathDirective =
|
||||||
|
`\nThe above agent instructions were loaded from ${instructionsFilePath}. ` +
|
||||||
|
`Resolve any relative file references from ${instructionsFileDir}. ` +
|
||||||
|
`This base directory is authoritative for sibling instruction files such as ` +
|
||||||
|
`./HEARTBEAT.md, ./SOUL.md, and ./TOOLS.md; do not resolve those from the parent agent directory.`;
|
||||||
const combinedPath = path.join(skillsDir, "agent-instructions.md");
|
const combinedPath = path.join(skillsDir, "agent-instructions.md");
|
||||||
await fs.writeFile(combinedPath, instructionsContent + pathDirective, "utf-8");
|
await fs.writeFile(combinedPath, instructionsContent + pathDirective, "utf-8");
|
||||||
effectiveInstructionsFilePath = combinedPath;
|
effectiveInstructionsFilePath = combinedPath;
|
||||||
|
|
|
||||||
|
|
@ -320,7 +320,10 @@ describe("claude execute", () => {
|
||||||
expect(captured[1]?.appendedSystemPromptFilePath).not.toBe(instructionsFile);
|
expect(captured[1]?.appendedSystemPromptFilePath).not.toBe(instructionsFile);
|
||||||
expect(captured[1]?.appendedSystemPromptFileContents).toContain("# Agent instructions");
|
expect(captured[1]?.appendedSystemPromptFileContents).toContain("# Agent instructions");
|
||||||
expect(captured[1]?.appendedSystemPromptFileContents).toContain(
|
expect(captured[1]?.appendedSystemPromptFileContents).toContain(
|
||||||
`The above agent instructions were loaded from ${instructionsFile}. Resolve any relative file references from ${path.dirname(instructionsFile)}/.`,
|
`The above agent instructions were loaded from ${instructionsFile}. ` +
|
||||||
|
`Resolve any relative file references from ${path.dirname(instructionsFile)}/. ` +
|
||||||
|
`This base directory is authoritative for sibling instruction files such as ` +
|
||||||
|
`./HEARTBEAT.md, ./SOUL.md, and ./TOOLS.md; do not resolve those from the parent agent directory.`,
|
||||||
);
|
);
|
||||||
expect(metaEvents).toHaveLength(2);
|
expect(metaEvents).toHaveLength(2);
|
||||||
expect(metaEvents[0]?.commandNotes).toHaveLength(0);
|
expect(metaEvents[0]?.commandNotes).toHaveLength(0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue