Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,11 @@ function generateCodexAgentToml(agentName, agentContent) {

const lines = [
`sandbox_mode = "${sandboxMode}"`,
`developer_instructions = """`,
// Agent prompts contain raw backslashes in regexes and shell snippets.
// TOML literal multiline strings preserve them without escape parsing.
`developer_instructions = '''`,
instructions,
`"""`,
`'''`,
];
return lines.join('\n') + '\n';
}
Expand Down
4 changes: 2 additions & 2 deletions tests/codex-config.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ tools: Read, Grep, Glob

test('includes developer_instructions from body', () => {
const result = generateCodexAgentToml('gsd-executor', sampleAgent);
assert.ok(result.includes('developer_instructions = """'), 'has triple-quoted instructions');
assert.ok(result.includes("developer_instructions = '''"), 'has literal triple-quoted instructions');
assert.ok(result.includes('<role>You are an executor.</role>'), 'body content in instructions');
assert.ok(result.includes('"""'), 'has closing triple quotes');
assert.ok(result.includes("'''"), 'has closing literal triple quotes');
});

test('defaults unknown agents to read-only', () => {
Expand Down
Loading