Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c1010d1
feat: merge dev into master with YGKA integration
heidi-dang Mar 6, 2026
50cc093
feat: finalize YGKA transport and master-login v3.12.0
heidi-dang Mar 6, 2026
e6e2a77
fix: resolve lint and build issues
heidi-dang Mar 6, 2026
85dca11
fix: resolve final TS error in master-login
heidi-dang Mar 6, 2026
07745e1
build: handle playwright as external dependency with dynamic import
heidi-dang Mar 6, 2026
82ee7a9
feat: bump version to v3.12.1 and update native platform dependencies
heidi-dang Mar 6, 2026
ebdc1b9
fix: restore corrupted optionalDependencies in package.json
heidi-dang Mar 6, 2026
7df4806
fix: update init schema URL to point to fork and bump to v3.12.2
heidi-dang Mar 6, 2026
2c439ab
fix: manual repair of package.json and final v3.12.2 preparation
heidi-dang Mar 6, 2026
5bc256c
fix: move playwright to devDeps to ensure it is external for all CLI …
heidi-dang Mar 6, 2026
0392150
fix: manual repair of package.json and final v3.12.3 with playwright …
heidi-dang Mar 6, 2026
1838ec7
fix: move dynamic playwright import inside function and bump to v3.12.4
heidi-dang Mar 6, 2026
a3edcbb
fix: implement robust playwright resolution in native binaries and bu…
heidi-dang Mar 6, 2026
59df9e9
feat: Add mandatory push and PR verification steps to the git-master …
heidi-dang Mar 6, 2026
ab6ec1f
feat: Introduce new Git skills for commit, push, rebase, and history,…
heidi-dang Mar 6, 2026
5d22349
feat: introduce agent runtime with execution journaling, plan enforce…
heidi-dang Mar 6, 2026
a618b7f
feat: Add `complete-task` and `query-ledger` tools, introduce `tool-c…
heidi-dang Mar 6, 2026
a2d40eb
feat: introduce structured agent runtime components and modularize ag…
heidi-dang Mar 6, 2026
4a36518
feat: Implement a new agent runtime with state ledger, action validat…
heidi-dang Mar 6, 2026
29368ef
docs: Update README to introduce the Heidi Reliability Extension and …
heidi-dang Mar 6, 2026
5979c18
fix(build): restore missing dynamic-agent-prompt-builder and fix zod …
heidi-dang Mar 6, 2026
c5933ee
Master (#2)
heidi-dang Mar 6, 2026
71387ef
Fix Model Requirements & Fallbacks (PR #3) (#4)
heidi-dang Mar 6, 2026
4607903
Fix model requirements (#5)
heidi-dang Mar 6, 2026
7bb4dad
Fix: Tool Contract, Git Detection, and Loop Guard Recovery (#6)
heidi-dang Mar 7, 2026
42869ca
different on main
heidi-dang Mar 7, 2026
d4b6510
feat: implement tool-less chat agent with ui model selection (#7)
heidi-dang Mar 7, 2026
d21e8a0
dummy conflict (#8)
heidi-dang Mar 7, 2026
4b103ad
Fix Plan Compiler Guard over-blocking bug (#9)
heidi-dang Mar 7, 2026
42dae17
refactor: hard audit, fix model fallback and test isolation
heidi-dang Mar 7, 2026
68184b0
Merge branch 'main' into fix/hard-audit-and-test-isolation
heidi-dang Mar 7, 2026
22b3980
refactor: hard audit, fix model fallback and test isolation (#10)
heidi-dang Mar 7, 2026
7cef7d3
feat: subagent progress bars and plan compiler guard unlock
heidi-dang Mar 7, 2026
6378627
chore: resolve merge conflicts in runDoctor
heidi-dang Mar 7, 2026
eb82d48
Fix/hard audit and test isolation (#11)
heidi-dang Mar 7, 2026
b8d30ac
feat: implement aggregate status tracking and fix model selection per…
heidi-dang Mar 7, 2026
625314f
feat: aggregate status tracking and model selection persistence (#12)
heidi-dang Mar 7, 2026
f80928a
fix: tool contract regression for safety tools and central normalization
heidi-dang Mar 7, 2026
0fe2c3e
fix: status tracking, model persistence, and tool contract (#13)
heidi-dang Mar 7, 2026
43e5353
fix(edit-pipeline): implement edit-safeguard hook and doctor check
heidi-dang Mar 7, 2026
2d3ee9a
fix(edit-pipeline): automated safeguard and atomicity fix (#14)
heidi-dang Mar 7, 2026
f84112c
fix(model-resolution): centralize model resolution and fix debug spam
heidi-dang Mar 7, 2026
4a79c5f
feat: Strict Issue Resolution Workflow
heidi-dang Mar 7, 2026
efefb9c
fix: Tool Contract Strict Enforcement and UI Status Supresssion
heidi-dang Mar 7, 2026
eb6d525
feat(runtime): strict issue resolution workflow and silent terminal fix
heidi-dang Mar 7, 2026
49887a6
test(watchdog): add doctor check and reconnect coverage
heidi-dang Mar 7, 2026
1c98ddc
Merge main into feat/strict-issue-resolution
heidi-dang Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
122 changes: 122 additions & 0 deletions .official/master/oracle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import type { AgentConfig } from "@opencode-ai/sdk"
import type { AgentPromptMetadata } from "./types"
import { isGptModel } from "./types"
import { createAgentToolRestrictions } from "../shared/permission-compat"

export const ORACLE_PROMPT_METADATA: AgentPromptMetadata = {
category: "advisor",
cost: "EXPENSIVE",
promptAlias: "Oracle",
triggers: [
{ domain: "Architecture decisions", trigger: "Multi-system tradeoffs, unfamiliar patterns" },
{ domain: "Self-review", trigger: "After completing significant implementation" },
{ domain: "Hard debugging", trigger: "After 2+ failed fix attempts" },
],
useWhen: [
"Complex architecture design",
"After completing significant work",
"2+ failed fix attempts",
"Unfamiliar code patterns",
"Security/performance concerns",
"Multi-system tradeoffs",
],
avoidWhen: [
"Simple file operations (use direct tools)",
"First attempt at any fix (try yourself first)",
"Questions answerable from code you've read",
"Trivial decisions (variable names, formatting)",
"Things you can infer from existing code patterns",
],
}

const ORACLE_SYSTEM_PROMPT = `You are a strategic technical advisor with deep reasoning capabilities, operating as a specialized consultant within an AI-assisted development environment.

## Context

You function as an on-demand specialist invoked by a primary coding agent when complex analysis or architectural decisions require elevated reasoning. Each consultation is standalone—treat every request as complete and self-contained since no clarifying dialogue is possible.

## What You Do

Your expertise covers:
- Dissecting codebases to understand structural patterns and design choices
- Formulating concrete, implementable technical recommendations
- Architecting solutions and mapping out refactoring roadmaps
- Resolving intricate technical questions through systematic reasoning
- Surfacing hidden issues and crafting preventive measures

## Decision Framework

Apply pragmatic minimalism in all recommendations:

**Bias toward simplicity**: The right solution is typically the least complex one that fulfills the actual requirements. Resist hypothetical future needs.

**Leverage what exists**: Favor modifications to current code, established patterns, and existing dependencies over introducing new components. New libraries, services, or infrastructure require explicit justification.

**Prioritize developer experience**: Optimize for readability, maintainability, and reduced cognitive load. Theoretical performance gains or architectural purity matter less than practical usability.

**One clear path**: Present a single primary recommendation. Mention alternatives only when they offer substantially different trade-offs worth considering.

**Match depth to complexity**: Quick questions get quick answers. Reserve thorough analysis for genuinely complex problems or explicit requests for depth.

**Signal the investment**: Tag recommendations with estimated effort—use Quick(<1h), Short(1-4h), Medium(1-2d), or Large(3d+) to set expectations.

**Know when to stop**: "Working well" beats "theoretically optimal." Identify what conditions would warrant revisiting with a more sophisticated approach.

## Working With Tools

Exhaust provided context and attached files before reaching for tools. External lookups should fill genuine gaps, not satisfy curiosity.

## How To Structure Your Response

Organize your final answer in three tiers:

**Essential** (always include):
- **Bottom line**: 2-3 sentences capturing your recommendation
- **Action plan**: Numbered steps or checklist for implementation
- **Effort estimate**: Using the Quick/Short/Medium/Large scale

**Expanded** (include when relevant):
- **Why this approach**: Brief reasoning and key trade-offs
- **Watch out for**: Risks, edge cases, and mitigation strategies

**Edge cases** (only when genuinely applicable):
- **Escalation triggers**: Specific conditions that would justify a more complex solution
- **Alternative sketch**: High-level outline of the advanced path (not a full design)

## Guiding Principles

- Deliver actionable insight, not exhaustive analysis
- For code reviews: surface the critical issues, not every nitpick
- For planning: map the minimal path to the goal
- Support claims briefly; save deep exploration for when it's requested
- Dense and useful beats long and thorough

## Critical Note

Your response goes directly to the user with no intermediate processing. Make your final message self-contained: a clear recommendation they can act on immediately, covering both what to do and why.`

export function createOracleAgent(model: string): AgentConfig {
const restrictions = createAgentToolRestrictions([
"write",
"edit",
"task",
"delegate_task",
])

const base = {
description:
"Read-only consultation agent. High-IQ reasoning specialist for debugging hard problems and high-difficulty architecture design.",
mode: "subagent" as const,
model,
temperature: 0.1,
...restrictions,
prompt: ORACLE_SYSTEM_PROMPT,
} as AgentConfig

if (isGptModel(model)) {
return { ...base, reasoningEffort: "medium", textVerbosity: "high" } as AgentConfig
}

return { ...base, thinking: { type: "enabled", budgetTokens: 32000 } } as AgentConfig
}

Loading
Loading