feat(agents): add centralized GPT apply_patch permission guard
Extract hardcoded GPT apply_patch permission logic into a reusable module
to ensure consistent behavior across all agents. This prevents GPT models
from using the unreliable apply_patch tool while allowing other models.
- Add gpt-apply-patch-guard.ts with GPT_APPLY_PATCH_GUIDANCE and getGptApplyPatchPermission
- Update Hephaestus agent to use centralized permission logic
- Update Sisyphus-Junior agent to use centralized permission logic
- Update all GPT prompt builders to reference shared guidance constant
🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/** GPT-5.3 Codex optimized Hephaestus prompt */
|
||||
import { GPT_APPLY_PATCH_GUIDANCE } from "../gpt-apply-patch-guard";
|
||||
import type { AgentConfig } from "@opencode-ai/sdk";
|
||||
import type { AgentMode } from "../types";
|
||||
import type {
|
||||
@@ -448,7 +449,7 @@ ${oracleSection}
|
||||
1. SEARCH existing codebase for similar patterns/styles
|
||||
2. Match naming, indentation, import styles, error handling conventions
|
||||
3. Default to ASCII. Add comments only for non-obvious blocks
|
||||
4. Use the \`edit\` and \`write\` tools for file changes. Do not use \`apply_patch\` on GPT models - it is unreliable here and can hang during verification.
|
||||
4. ${GPT_APPLY_PATCH_GUIDANCE}
|
||||
|
||||
### After Implementation (MANDATORY - DO NOT SKIP)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user