Skip to content

Commit 75447b7

Browse files
committed
fix(hephaestus): restrict Oracle to failure-escalation only in GPT-5.4 prompt
Replace generic buildOracleSection (proactive triggers: architecture, significant work, unfamiliar patterns) with Hephaestus-specific Oracle section that only permits consultation after 2+ failed attempts. Aligns with autonomous deep worker identity - try first, escalate later.
1 parent d55a523 commit 75447b7

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/agents/hephaestus/gpt-5-4.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import {
3434
buildLibrarianSection,
3535
buildCategorySkillsDelegationGuide,
3636
buildDelegationTable,
37-
buildOracleSection,
3837
buildHardBlocksSection,
3938
buildAntiPatternsSection,
4039
buildAntiDuplicationSection,
@@ -102,7 +101,7 @@ export function buildHephaestusPrompt(
102101
availableSkills,
103102
);
104103
const delegationTable = buildDelegationTable(availableAgents);
105-
const oracleSection = buildOracleSection(availableAgents);
104+
const hasOracle = availableAgents.some((agent) => agent.name === "oracle");
106105
const hardBlocks = buildHardBlocksSection();
107106
const antiPatterns = buildAntiPatternsSection();
108107
const antiDuplication = buildAntiDuplicationSection();
@@ -319,7 +318,23 @@ Every \`task()\` returns a session_id. Use it for all follow-ups:
319318
320319
This preserves full context, avoids repeated exploration, saves 70%+ tokens.
321320
</session_continuity>
322-
${oracleSection ? `\n${oracleSection}` : ""}
321+
${hasOracle ? `
322+
<oracle>
323+
Oracle is a read-only reasoning model, available as a last-resort escalation path when you are genuinely stuck.
324+
325+
Consult Oracle only when:
326+
- You have tried 2+ materially different approaches and all failed
327+
- You have documented what you tried and why each approach failed
328+
- The problem requires architectural insight beyond what codebase exploration provides
329+
330+
Do not consult Oracle:
331+
- Before attempting the fix yourself (try first, escalate later)
332+
- For questions answerable from code you have already read
333+
- For routine decisions, even complex ones you can reason through
334+
- On your first or second attempt at any task
335+
336+
If you do consult Oracle, announce "Consulting Oracle for [reason]" before invocation. Collect Oracle results before your final answer. Do not implement Oracle-dependent changes until Oracle finishes - do only non-overlapping prep work while waiting. Oracle takes minutes; end your response and wait for the system notification. Never poll, never cancel Oracle.
337+
</oracle>` : ""}
323338
</delegation>`;
324339

325340
const communicationBlock = `<communication>

0 commit comments

Comments
 (0)