oh-my-opencode 4.16.1 → 4.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/pre-publish-review/SKILL.md +3 -0
- package/README.md +2 -2
- package/dist/agents/hephaestus/agent.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-6.d.ts +2 -0
- package/dist/agents/momus-gpt-5-6.d.ts +1 -0
- package/dist/agents/types.d.ts +2 -0
- package/dist/cli/index.js +800 -536
- package/dist/cli-node/index.js +800 -536
- package/dist/features/background-agent/error-classifier.d.ts +5 -0
- package/dist/features/background-agent/parent-wake-dedupe.d.ts +1 -0
- package/dist/features/background-agent/parent-wake-flush-runner.d.ts +2 -0
- package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -0
- package/dist/features/builtin-commands/templates/refactor-sections/intro-and-analysis.d.ts +1 -1
- package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
- package/dist/index.js +464 -54
- package/dist/shared/live-server-route.d.ts +1 -1
- package/dist/skills/review-work/SKILL.md +4 -2
- package/dist/skills/start-work/SKILL.md +2 -0
- package/dist/skills/ulw-plan/references/full-workflow.md +1 -1
- package/dist/skills/ulw-research/SKILL.md +5 -3
- package/dist/skills/visual-qa/SKILL.md +1 -1
- package/dist/tui.js +125 -13
- package/package.json +13 -13
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +398 -246
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/bundled-rules/{hephaestus.md → hephaestus/gpt-5.5.md} +1 -1
- package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +93 -0
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +43 -24
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +2 -1
- package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +15 -6
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +7 -2
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +2 -2
- package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +32 -0
- package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +106 -0
- package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +1 -1
- package/packages/omo-codex/plugin/components/teammode/AGENTS.md +12 -9
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +136 -76
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +94 -23
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-state.mjs +94 -14
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-transport.mjs +55 -0
- package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +72 -18
- package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +23 -0
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +24 -41
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-executor.toml +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +21 -49
- package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +17 -29
- package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +20 -50
- package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +18 -39
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +1 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +2 -0
- package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +1 -0
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +2 -0
- package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +13 -13
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/auto-update.mjs +73 -19
- package/packages/omo-codex/plugin/scripts/entry-guard.mjs +26 -0
- package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +3 -1
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +221 -20
- package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +71 -3
- package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +35 -7
- package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-hook-status-messages.mjs +2 -2
- package/packages/omo-codex/plugin/scripts/sync-skills.mjs +7 -5
- package/packages/omo-codex/plugin/scripts/sync-version.mjs +4 -2
- package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/review-work/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -2
- package/packages/omo-codex/plugin/skills/teammode/SKILL.md +136 -76
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +94 -23
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-state.mjs +94 -14
- package/packages/omo-codex/plugin/skills/teammode/scripts/team-transport.mjs +55 -0
- package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +72 -18
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +1 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +2 -0
- package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +1 -1
- package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +2 -0
- package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +3 -1
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +3 -3
- package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +47 -1
- package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +1 -1
- package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +4 -2
- package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +33 -0
- package/packages/omo-codex/plugin/test/auto-update.test.mjs +35 -1
- package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +412 -19
- package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +71 -0
- package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +65 -0
- package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +13 -4
- package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +345 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +436 -284
- package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +111 -1
- package/packages/shared-skills/skills/review-work/SKILL.md +4 -2
- package/packages/shared-skills/skills/start-work/SKILL.md +2 -0
- package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +1 -1
- package/packages/shared-skills/skills/ulw-research/SKILL.md +5 -3
- package/packages/shared-skills/skills/visual-qa/SKILL.md +1 -1
package/dist/index.js
CHANGED
|
@@ -20933,6 +20933,11 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
20933
20933
|
},
|
|
20934
20934
|
hephaestus: {
|
|
20935
20935
|
fallbackChain: [
|
|
20936
|
+
{
|
|
20937
|
+
providers: ["openai", "vercel"],
|
|
20938
|
+
model: "gpt-5.6-sol",
|
|
20939
|
+
variant: "medium"
|
|
20940
|
+
},
|
|
20936
20941
|
{
|
|
20937
20942
|
providers: ["openai", "github-copilot", "opencode", "vercel"],
|
|
20938
20943
|
model: "gpt-5.5",
|
|
@@ -20959,7 +20964,7 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
20959
20964
|
model: "claude-opus-4-7",
|
|
20960
20965
|
variant: "max"
|
|
20961
20966
|
},
|
|
20962
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
20967
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" }
|
|
20963
20968
|
]
|
|
20964
20969
|
},
|
|
20965
20970
|
librarian: {
|
|
@@ -21006,7 +21011,7 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
21006
21011
|
model: "gpt-5.5",
|
|
21007
21012
|
variant: "high"
|
|
21008
21013
|
},
|
|
21009
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21014
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" },
|
|
21010
21015
|
{
|
|
21011
21016
|
providers: ["google", "github-copilot", "opencode", "vercel"],
|
|
21012
21017
|
model: "gemini-3.1-pro"
|
|
@@ -21029,12 +21034,17 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
21029
21034
|
model: "gpt-5.5",
|
|
21030
21035
|
variant: "high"
|
|
21031
21036
|
},
|
|
21032
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21037
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" },
|
|
21033
21038
|
{ providers: ["kimi-for-coding"], model: "k2p5" }
|
|
21034
21039
|
]
|
|
21035
21040
|
},
|
|
21036
21041
|
momus: {
|
|
21037
21042
|
fallbackChain: [
|
|
21043
|
+
{
|
|
21044
|
+
providers: ["openai", "vercel"],
|
|
21045
|
+
model: "gpt-5.6-sol",
|
|
21046
|
+
variant: "xhigh"
|
|
21047
|
+
},
|
|
21038
21048
|
{
|
|
21039
21049
|
providers: ["openai", "github-copilot", "opencode", "vercel"],
|
|
21040
21050
|
model: "gpt-5.5",
|
|
@@ -21050,7 +21060,7 @@ var AGENT_MODEL_REQUIREMENTS = {
|
|
|
21050
21060
|
model: "gemini-3.1-pro",
|
|
21051
21061
|
variant: "high"
|
|
21052
21062
|
},
|
|
21053
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21063
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" }
|
|
21054
21064
|
]
|
|
21055
21065
|
},
|
|
21056
21066
|
atlas: {
|
|
@@ -21098,12 +21108,17 @@ var CATEGORY_MODEL_REQUIREMENTS = {
|
|
|
21098
21108
|
model: "claude-opus-4-7",
|
|
21099
21109
|
variant: "max"
|
|
21100
21110
|
},
|
|
21101
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21111
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" },
|
|
21102
21112
|
{ providers: ["kimi-for-coding"], model: "k2p5" }
|
|
21103
21113
|
]
|
|
21104
21114
|
},
|
|
21105
21115
|
ultrabrain: {
|
|
21106
21116
|
fallbackChain: [
|
|
21117
|
+
{
|
|
21118
|
+
providers: ["openai", "vercel"],
|
|
21119
|
+
model: "gpt-5.6-sol",
|
|
21120
|
+
variant: "xhigh"
|
|
21121
|
+
},
|
|
21107
21122
|
{
|
|
21108
21123
|
providers: ["openai", "opencode", "vercel"],
|
|
21109
21124
|
model: "gpt-5.5",
|
|
@@ -21119,11 +21134,16 @@ var CATEGORY_MODEL_REQUIREMENTS = {
|
|
|
21119
21134
|
model: "claude-opus-4-7",
|
|
21120
21135
|
variant: "max"
|
|
21121
21136
|
},
|
|
21122
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21137
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" }
|
|
21123
21138
|
]
|
|
21124
21139
|
},
|
|
21125
21140
|
deep: {
|
|
21126
21141
|
fallbackChain: [
|
|
21142
|
+
{
|
|
21143
|
+
providers: ["openai", "vercel"],
|
|
21144
|
+
model: "gpt-5.6-sol",
|
|
21145
|
+
variant: "high"
|
|
21146
|
+
},
|
|
21127
21147
|
{
|
|
21128
21148
|
providers: ["openai", "github-copilot", "opencode", "vercel"],
|
|
21129
21149
|
model: "gpt-5.5",
|
|
@@ -21140,7 +21160,7 @@ var CATEGORY_MODEL_REQUIREMENTS = {
|
|
|
21140
21160
|
variant: "high"
|
|
21141
21161
|
},
|
|
21142
21162
|
{ providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
|
|
21143
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21163
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" }
|
|
21144
21164
|
]
|
|
21145
21165
|
},
|
|
21146
21166
|
artistry: {
|
|
@@ -21157,7 +21177,7 @@ var CATEGORY_MODEL_REQUIREMENTS = {
|
|
|
21157
21177
|
},
|
|
21158
21178
|
{ providers: ["openai", "github-copilot", "opencode", "vercel"], model: "gpt-5.5" },
|
|
21159
21179
|
{ providers: ["opencode-go", "vercel"], model: "kimi-k2.6" },
|
|
21160
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21180
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" }
|
|
21161
21181
|
]
|
|
21162
21182
|
},
|
|
21163
21183
|
quick: {
|
|
@@ -21215,7 +21235,7 @@ var CATEGORY_MODEL_REQUIREMENTS = {
|
|
|
21215
21235
|
},
|
|
21216
21236
|
{ providers: ["zai-coding-plan", "opencode", "bailian-coding-plan", "vercel"], model: "glm-5" },
|
|
21217
21237
|
{ providers: ["kimi-for-coding"], model: "k2p5" },
|
|
21218
|
-
{ providers: ["opencode-go", "vercel"], model: "glm-5.
|
|
21238
|
+
{ providers: ["opencode-go", "vercel"], model: "glm-5.2" },
|
|
21219
21239
|
{ providers: ["opencode", "bailian-coding-plan", "vercel"], model: "kimi-k2.5" },
|
|
21220
21240
|
{
|
|
21221
21241
|
providers: [
|
|
@@ -22567,6 +22587,22 @@ var SUPPLEMENTAL_MODEL_CAPABILITIES = {
|
|
|
22567
22587
|
output: 262144
|
|
22568
22588
|
}
|
|
22569
22589
|
},
|
|
22590
|
+
"gpt-5.6-sol": {
|
|
22591
|
+
id: "gpt-5.6-sol",
|
|
22592
|
+
family: "gpt",
|
|
22593
|
+
reasoning: true,
|
|
22594
|
+
temperature: false,
|
|
22595
|
+
toolCall: true,
|
|
22596
|
+
modalities: {
|
|
22597
|
+
input: ["text", "image", "pdf"],
|
|
22598
|
+
output: ["text"]
|
|
22599
|
+
},
|
|
22600
|
+
limit: {
|
|
22601
|
+
context: 1050000,
|
|
22602
|
+
input: 922000,
|
|
22603
|
+
output: 128000
|
|
22604
|
+
}
|
|
22605
|
+
},
|
|
22570
22606
|
"gpt-5.5": {
|
|
22571
22607
|
id: "gpt-5.5",
|
|
22572
22608
|
family: "gpt",
|
|
@@ -23696,6 +23732,10 @@ function isGpt5_5Model(model) {
|
|
|
23696
23732
|
const modelName = extractModelName2(model).toLowerCase();
|
|
23697
23733
|
return modelName.includes("gpt-5.5") || modelName.includes("gpt-5-5");
|
|
23698
23734
|
}
|
|
23735
|
+
function isGpt5_6Model(model) {
|
|
23736
|
+
const modelName = extractModelName2(model).toLowerCase();
|
|
23737
|
+
return modelName.includes("gpt-5.6") || modelName.includes("gpt-5-6");
|
|
23738
|
+
}
|
|
23699
23739
|
|
|
23700
23740
|
// packages/omo-opencode/src/tools/delegate-task/openai-categories.ts
|
|
23701
23741
|
var ULTRABRAIN_CATEGORY_PROMPT_APPEND = `<Category_Context>
|
|
@@ -23761,7 +23801,7 @@ The orchestrator chose this category because the task benefits from depth over s
|
|
|
23761
23801
|
**Status cadence: sparse.** The user is not on the other side of this conversation; the orchestrator is, and they will synthesize your progress. Send commentary only at meaningful phase transitions (starting exploration, starting implementation, starting verification, hitting a genuine blocker). Do not narrate every tool call; silence during focused work is expected.
|
|
23762
23802
|
</Category_Context>`;
|
|
23763
23803
|
function resolveDeepCategoryPromptAppend(model) {
|
|
23764
|
-
if (model && isGpt5_5Model(model)) {
|
|
23804
|
+
if (model && (isGpt5_5Model(model) || isGpt5_6Model(model))) {
|
|
23765
23805
|
return DEEP_CATEGORY_PROMPT_APPEND_GPT_5_5;
|
|
23766
23806
|
}
|
|
23767
23807
|
return DEEP_CATEGORY_PROMPT_APPEND;
|
|
@@ -23819,13 +23859,13 @@ If your prompt lacks this structure, REWRITE IT before delegating.
|
|
|
23819
23859
|
var OPENAI_CATEGORIES = [
|
|
23820
23860
|
{
|
|
23821
23861
|
name: "ultrabrain",
|
|
23822
|
-
config: { model: "openai/gpt-5.
|
|
23862
|
+
config: { model: "openai/gpt-5.6-sol", variant: "xhigh" },
|
|
23823
23863
|
description: "Use ONLY for genuinely hard, logic-heavy tasks. Give clear goals only, not step-by-step instructions.",
|
|
23824
23864
|
promptAppend: ULTRABRAIN_CATEGORY_PROMPT_APPEND
|
|
23825
23865
|
},
|
|
23826
23866
|
{
|
|
23827
23867
|
name: "deep",
|
|
23828
|
-
config: { model: "openai/gpt-5.
|
|
23868
|
+
config: { model: "openai/gpt-5.6-sol", variant: "high" },
|
|
23829
23869
|
description: "Goal-oriented autonomous problem-solving on hairy problems requiring deep research. ONE goal + ONE deliverable per call \u2014 multiple goals must fan out as parallel `deep` calls, never bundled into one.",
|
|
23830
23870
|
promptAppend: DEEP_CATEGORY_PROMPT_APPEND,
|
|
23831
23871
|
resolvePromptAppend: resolveDeepCategoryPromptAppend
|
|
@@ -78000,6 +78040,7 @@ function injectServerAuthIntoClient(client3) {
|
|
|
78000
78040
|
init_logger2();
|
|
78001
78041
|
var PROBE_TTL_MS = 60000;
|
|
78002
78042
|
var PROBE_ABORT_MS = 1500;
|
|
78043
|
+
var AFFINITY_TTL_MS = 60000;
|
|
78003
78044
|
var registrations = new Map;
|
|
78004
78045
|
var lastRegistration;
|
|
78005
78046
|
var liveParentWakeRoutingDisabled = false;
|
|
@@ -78017,7 +78058,9 @@ function initLiveServerRoute(opts) {
|
|
|
78017
78058
|
available: undefined,
|
|
78018
78059
|
probeTimestamp: 0,
|
|
78019
78060
|
inFlightProbe: undefined,
|
|
78020
|
-
warnedOnce: false
|
|
78061
|
+
warnedOnce: false,
|
|
78062
|
+
sessionAffinity: new Map,
|
|
78063
|
+
inFlightAffinity: new Map
|
|
78021
78064
|
};
|
|
78022
78065
|
registrations.set(opts.inProcessClient, registration);
|
|
78023
78066
|
lastRegistration = registration;
|
|
@@ -78071,6 +78114,66 @@ async function probe(registration) {
|
|
|
78071
78114
|
return false;
|
|
78072
78115
|
}
|
|
78073
78116
|
}
|
|
78117
|
+
async function probeSessionAffinity(registration, sessionID) {
|
|
78118
|
+
if (!registration.serverUrl) {
|
|
78119
|
+
return;
|
|
78120
|
+
}
|
|
78121
|
+
const probeUrl = new URL(`/session/${sessionID}`, registration.serverUrl);
|
|
78122
|
+
const authHeader = getServerBasicAuthHeader();
|
|
78123
|
+
const headers = authHeader ? { Authorization: authHeader } : {};
|
|
78124
|
+
try {
|
|
78125
|
+
const controller = new AbortController;
|
|
78126
|
+
const timeoutId = setTimeout(() => controller.abort(), PROBE_ABORT_MS);
|
|
78127
|
+
let response;
|
|
78128
|
+
try {
|
|
78129
|
+
response = await getFetch()(probeUrl, { headers, signal: controller.signal });
|
|
78130
|
+
} finally {
|
|
78131
|
+
clearTimeout(timeoutId);
|
|
78132
|
+
}
|
|
78133
|
+
if (response.ok) {
|
|
78134
|
+
setSessionAffinity(registration, sessionID, true);
|
|
78135
|
+
return true;
|
|
78136
|
+
}
|
|
78137
|
+
if (response.status === 404) {
|
|
78138
|
+
setSessionAffinity(registration, sessionID, false);
|
|
78139
|
+
log2("[live-server-route] live listener does not own session; falling back to in-process client", { sessionID });
|
|
78140
|
+
return false;
|
|
78141
|
+
}
|
|
78142
|
+
return;
|
|
78143
|
+
} catch {
|
|
78144
|
+
return;
|
|
78145
|
+
}
|
|
78146
|
+
}
|
|
78147
|
+
function setSessionAffinity(registration, sessionID, owned) {
|
|
78148
|
+
const now = Date.now();
|
|
78149
|
+
for (const [key, entry] of registration.sessionAffinity) {
|
|
78150
|
+
if (now - entry.timestamp >= AFFINITY_TTL_MS) {
|
|
78151
|
+
registration.sessionAffinity.delete(key);
|
|
78152
|
+
}
|
|
78153
|
+
}
|
|
78154
|
+
registration.sessionAffinity.set(sessionID, { owned, timestamp: now });
|
|
78155
|
+
}
|
|
78156
|
+
function getFreshSessionAffinity(registration, sessionID) {
|
|
78157
|
+
const entry = registration.sessionAffinity.get(sessionID);
|
|
78158
|
+
if (!entry || Date.now() - entry.timestamp >= AFFINITY_TTL_MS) {
|
|
78159
|
+
return;
|
|
78160
|
+
}
|
|
78161
|
+
return entry.owned;
|
|
78162
|
+
}
|
|
78163
|
+
async function resolveSessionAffinity(registration, sessionID) {
|
|
78164
|
+
const cached = getFreshSessionAffinity(registration, sessionID);
|
|
78165
|
+
if (cached !== undefined) {
|
|
78166
|
+
return cached;
|
|
78167
|
+
}
|
|
78168
|
+
let inFlight = registration.inFlightAffinity.get(sessionID);
|
|
78169
|
+
if (!inFlight) {
|
|
78170
|
+
inFlight = probeSessionAffinity(registration, sessionID).finally(() => {
|
|
78171
|
+
registration.inFlightAffinity.delete(sessionID);
|
|
78172
|
+
});
|
|
78173
|
+
registration.inFlightAffinity.set(sessionID, inFlight);
|
|
78174
|
+
}
|
|
78175
|
+
return inFlight;
|
|
78176
|
+
}
|
|
78074
78177
|
function getFreshProbeAvailability(registration) {
|
|
78075
78178
|
const available = registration.available;
|
|
78076
78179
|
if (available === undefined || Date.now() - registration.probeTimestamp >= PROBE_TTL_MS) {
|
|
@@ -78123,6 +78226,13 @@ function tryResolveDispatchClientSync2(client3, sessionID) {
|
|
|
78123
78226
|
if (!freshAvailability) {
|
|
78124
78227
|
return { client: client3, route: "in-process", reason: "unavailable" };
|
|
78125
78228
|
}
|
|
78229
|
+
const cachedAffinity = getFreshSessionAffinity(registration, sessionID);
|
|
78230
|
+
if (cachedAffinity === undefined) {
|
|
78231
|
+
return;
|
|
78232
|
+
}
|
|
78233
|
+
if (!cachedAffinity) {
|
|
78234
|
+
return { client: client3, route: "in-process", reason: "affinity" };
|
|
78235
|
+
}
|
|
78126
78236
|
const resolvedLiveClient = getOrBuildLiveClient(registration);
|
|
78127
78237
|
if (!resolvedLiveClient) {
|
|
78128
78238
|
return { client: client3, route: "in-process", reason: "unavailable" };
|
|
@@ -78142,6 +78252,10 @@ async function resolveDispatchClient2(client3, sessionID) {
|
|
|
78142
78252
|
if (!isAvailable) {
|
|
78143
78253
|
return { client: client3, route: "in-process", reason: "unavailable" };
|
|
78144
78254
|
}
|
|
78255
|
+
const affinity = await resolveSessionAffinity(registration, sessionID);
|
|
78256
|
+
if (affinity === false) {
|
|
78257
|
+
return { client: client3, route: "in-process", reason: "affinity" };
|
|
78258
|
+
}
|
|
78145
78259
|
const resolvedLiveClient = getOrBuildLiveClient(registration);
|
|
78146
78260
|
if (!resolvedLiveClient) {
|
|
78147
78261
|
return { client: client3, route: "in-process", reason: "unavailable" };
|
|
@@ -78179,6 +78293,7 @@ function markLiveRouteUnavailable2(reason) {
|
|
|
78179
78293
|
for (const registration of registrations.values()) {
|
|
78180
78294
|
registration.available = false;
|
|
78181
78295
|
registration.probeTimestamp = Date.now();
|
|
78296
|
+
registration.sessionAffinity.clear();
|
|
78182
78297
|
}
|
|
78183
78298
|
log2(`[live-server-route] marked unavailable: ${reason}`);
|
|
78184
78299
|
}
|
|
@@ -89498,7 +89613,7 @@ function getCachedVersion(options = {}) {
|
|
|
89498
89613
|
// package.json
|
|
89499
89614
|
var package_default = {
|
|
89500
89615
|
name: "oh-my-opencode",
|
|
89501
|
-
version: "4.16.
|
|
89616
|
+
version: "4.16.3",
|
|
89502
89617
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
89503
89618
|
main: "./dist/index.js",
|
|
89504
89619
|
types: "dist/index.d.ts",
|
|
@@ -89708,18 +89823,18 @@ var package_default = {
|
|
|
89708
89823
|
typescript: "^6.0.3"
|
|
89709
89824
|
},
|
|
89710
89825
|
optionalDependencies: {
|
|
89711
|
-
"oh-my-opencode-darwin-arm64": "4.16.
|
|
89712
|
-
"oh-my-opencode-darwin-x64": "4.16.
|
|
89713
|
-
"oh-my-opencode-darwin-x64-baseline": "4.16.
|
|
89714
|
-
"oh-my-opencode-linux-arm64": "4.16.
|
|
89715
|
-
"oh-my-opencode-linux-arm64-musl": "4.16.
|
|
89716
|
-
"oh-my-opencode-linux-x64": "4.16.
|
|
89717
|
-
"oh-my-opencode-linux-x64-baseline": "4.16.
|
|
89718
|
-
"oh-my-opencode-linux-x64-musl": "4.16.
|
|
89719
|
-
"oh-my-opencode-linux-x64-musl-baseline": "4.16.
|
|
89720
|
-
"oh-my-opencode-windows-arm64": "4.16.
|
|
89721
|
-
"oh-my-opencode-windows-x64": "4.16.
|
|
89722
|
-
"oh-my-opencode-windows-x64-baseline": "4.16.
|
|
89826
|
+
"oh-my-opencode-darwin-arm64": "4.16.3",
|
|
89827
|
+
"oh-my-opencode-darwin-x64": "4.16.3",
|
|
89828
|
+
"oh-my-opencode-darwin-x64-baseline": "4.16.3",
|
|
89829
|
+
"oh-my-opencode-linux-arm64": "4.16.3",
|
|
89830
|
+
"oh-my-opencode-linux-arm64-musl": "4.16.3",
|
|
89831
|
+
"oh-my-opencode-linux-x64": "4.16.3",
|
|
89832
|
+
"oh-my-opencode-linux-x64-baseline": "4.16.3",
|
|
89833
|
+
"oh-my-opencode-linux-x64-musl": "4.16.3",
|
|
89834
|
+
"oh-my-opencode-linux-x64-musl-baseline": "4.16.3",
|
|
89835
|
+
"oh-my-opencode-windows-arm64": "4.16.3",
|
|
89836
|
+
"oh-my-opencode-windows-x64": "4.16.3",
|
|
89837
|
+
"oh-my-opencode-windows-x64-baseline": "4.16.3"
|
|
89723
89838
|
},
|
|
89724
89839
|
overrides: {
|
|
89725
89840
|
"@earendil-works/pi-agent-core": "0.80.3",
|
|
@@ -103679,13 +103794,15 @@ This command includes examples for the OpenCode harness. In Codex, do not call O
|
|
|
103679
103794
|
|
|
103680
103795
|
| OpenCode example | Codex tool to use |
|
|
103681
103796
|
| --- | --- |
|
|
103682
|
-
| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(
|
|
103683
|
-
| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(
|
|
103684
|
-
| \`task(subagent_type="plan", ...)\` | \`spawn_agent(
|
|
103797
|
+
| \`call_omo_agent(subagent_type="explore", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as an explorer. ...","agent_type":"explorer","fork_context":false})\` |
|
|
103798
|
+
| \`call_omo_agent(subagent_type="librarian", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a librarian. ...","agent_type":"librarian","fork_context":false})\` |
|
|
103799
|
+
| \`task(subagent_type="plan", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a planning agent. ...","agent_type":"plan","fork_context":false})\` |
|
|
103685
103800
|
| \`task(subagent_type="oracle", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})\` |
|
|
103686
|
-
| \`task(category="...", ...)\` | \`spawn_agent(
|
|
103687
|
-
| \`background_output(task_id="...")\` | \`wait_agent(...)\`
|
|
103688
|
-
| \`team_*(...)\` | Use Codex native subagents
|
|
103801
|
+
| \`task(category="...", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})\` |
|
|
103802
|
+
| \`background_output(task_id="...")\` | \`multi_agent_v1.wait_agent(...)\` for mailbox signals |
|
|
103803
|
+
| \`team_*(...)\` | Use Codex native subagents via \`multi_agent_v1.spawn_agent\` and \`multi_agent_v1.wait_agent\`; use \`multi_agent_v1.send_input\` and \`multi_agent_v1.close_agent\` only when exposed in the active tools list |
|
|
103804
|
+
|
|
103805
|
+
Codex exposes ONE of two subagent tool surfaces per session; check your own tool list and route accordingly. If \`multi_agent_v1.*\` tools exist, use the table above as written. If instead a flat \`spawn_agent\` with a required \`task_name\` exists (\`multi_agent_v2\`), rewrite every \`multi_agent_v1.*\` example: \`multi_agent_v1.spawn_agent({...,"fork_context":false})\` becomes \`spawn_agent({"task_name":"<lowercase_digits_underscores>","message":...,"agent_type":...,"fork_turns":"none"})\` (\`"all"\` only when full parent history is truly required); \`send_input\` becomes \`send_message\`; do not call \`close_agent\`/\`resume_agent\` (finished agents end on their own; \`followup_task\` re-tasks one, \`interrupt_agent\` stops one); \`wait_agent\` takes only \`timeout_ms\` and returns on any child mailbox activity. \`agent_type\` works the same on both surfaces. If a code block below conflicts with this section, this section wins.
|
|
103689
103806
|
|
|
103690
103807
|
When translating \`load_skills=[...]\`, include the requested skill names in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins.
|
|
103691
103808
|
|
|
@@ -104649,13 +104766,15 @@ This command includes examples for the OpenCode harness. In Codex, do not call O
|
|
|
104649
104766
|
|
|
104650
104767
|
| OpenCode example | Codex tool to use |
|
|
104651
104768
|
| --- | --- |
|
|
104652
|
-
| \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent(
|
|
104653
|
-
| \`call_omo_agent(subagent_type="librarian", ...)\` | \`spawn_agent(
|
|
104654
|
-
| \`task(subagent_type="plan", ...)\` | \`spawn_agent(
|
|
104769
|
+
| \`call_omo_agent(subagent_type="explore", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as an explorer. ...","agent_type":"explorer","fork_context":false})\` |
|
|
104770
|
+
| \`call_omo_agent(subagent_type="librarian", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a librarian. ...","agent_type":"librarian","fork_context":false})\` |
|
|
104771
|
+
| \`task(subagent_type="plan", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a planning agent. ...","agent_type":"plan","fork_context":false})\` |
|
|
104655
104772
|
| \`task(subagent_type="oracle", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as a rigorous reviewer. ...","agent_type":"lazycodex-gate-reviewer","fork_context":false})\` |
|
|
104656
|
-
| \`task(category="...", ...)\` | \`spawn_agent(
|
|
104657
|
-
| \`background_output(task_id="...")\` | \`wait_agent(...)\`
|
|
104658
|
-
| \`team_*(...)\` | Use Codex native subagents
|
|
104773
|
+
| \`task(category="...", ...)\` | \`multi_agent_v1.spawn_agent({"message":"TASK: act as an implementation or QA worker. ...","fork_context":false})\` |
|
|
104774
|
+
| \`background_output(task_id="...")\` | \`multi_agent_v1.wait_agent(...)\` for mailbox signals |
|
|
104775
|
+
| \`team_*(...)\` | Use Codex native subagents via \`multi_agent_v1.spawn_agent\` and \`multi_agent_v1.wait_agent\`; use \`multi_agent_v1.send_input\` and \`multi_agent_v1.close_agent\` only when exposed in the active tools list |
|
|
104776
|
+
|
|
104777
|
+
Codex exposes ONE of two subagent tool surfaces per session; check your own tool list and route accordingly. If \`multi_agent_v1.*\` tools exist, use the table above as written. If instead a flat \`spawn_agent\` with a required \`task_name\` exists (\`multi_agent_v2\`), rewrite every \`multi_agent_v1.*\` example: \`multi_agent_v1.spawn_agent({...,"fork_context":false})\` becomes \`spawn_agent({"task_name":"<lowercase_digits_underscores>","message":...,"agent_type":...,"fork_turns":"none"})\` (\`"all"\` only when full parent history is truly required); \`send_input\` becomes \`send_message\`; do not call \`close_agent\`/\`resume_agent\` (finished agents end on their own; \`followup_task\` re-tasks one, \`interrupt_agent\` stops one); \`wait_agent\` takes only \`timeout_ms\` and returns on any child mailbox activity. \`agent_type\` works the same on both surfaces. If a code block below conflicts with this section, this section wins.
|
|
104659
104778
|
|
|
104660
104779
|
When translating \`load_skills=[...]\`, include the requested skill names in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins.
|
|
104661
104780
|
|
|
@@ -118876,6 +118995,30 @@ function getSessionErrorMessage(properties) {
|
|
|
118876
118995
|
const message = errorRaw["message"];
|
|
118877
118996
|
return typeof message === "string" ? message : undefined;
|
|
118878
118997
|
}
|
|
118998
|
+
var TERMINAL_SESSION_ERROR_PATTERNS = [
|
|
118999
|
+
/no provider available/i,
|
|
119000
|
+
/provider not (available|found|configured)/i,
|
|
119001
|
+
/provider is forbidden/i,
|
|
119002
|
+
/selected provider is forbidden/i,
|
|
119003
|
+
/unknown provider/i,
|
|
119004
|
+
/model not supported/i,
|
|
119005
|
+
/model_not_supported/i,
|
|
119006
|
+
/model[_\s-]*not[_\s-]*found/i,
|
|
119007
|
+
/(?:no|missing)[_\s-]*(?:api|auth(?:entication)?)[_\s-]*key/i,
|
|
119008
|
+
/(?:api|auth(?:entication)?)[_\s-]*key(?:[_\s-]+is)?[_\s-]*(?:missing|not[_\s-]*(?:found|configured)|required)/i,
|
|
119009
|
+
/no models available/i,
|
|
119010
|
+
/no connected providers/i,
|
|
119011
|
+
/all providers (?:are )?(?:unavailable|disconnected|exhausted)/i
|
|
119012
|
+
];
|
|
119013
|
+
function isTerminalSessionError(errorInfo) {
|
|
119014
|
+
const text = [
|
|
119015
|
+
errorInfo?.name,
|
|
119016
|
+
errorInfo?.message
|
|
119017
|
+
].filter((value) => typeof value === "string" && value.length > 0).join(" ");
|
|
119018
|
+
if (text.length === 0)
|
|
119019
|
+
return false;
|
|
119020
|
+
return TERMINAL_SESSION_ERROR_PATTERNS.some((pattern) => pattern.test(text));
|
|
119021
|
+
}
|
|
118879
119022
|
|
|
118880
119023
|
// packages/omo-opencode/src/tools/background-task/task-result-format.ts
|
|
118881
119024
|
function getTimeString(value) {
|
|
@@ -127737,6 +127880,7 @@ function cloneParentWake(wake) {
|
|
|
127737
127880
|
promptContext,
|
|
127738
127881
|
notifications: [...wake.notifications],
|
|
127739
127882
|
shouldReply: wake.shouldReply,
|
|
127883
|
+
...wake.queuedAt !== undefined ? { queuedAt: wake.queuedAt } : {},
|
|
127740
127884
|
...wake.dispatchedAt !== undefined ? { dispatchedAt: wake.dispatchedAt } : {},
|
|
127741
127885
|
...wake.noReplyAdmittedAt !== undefined ? { noReplyAdmittedAt: wake.noReplyAdmittedAt } : {},
|
|
127742
127886
|
...wake.toolCallDeferralStartedAt !== undefined ? { toolCallDeferralStartedAt: wake.toolCallDeferralStartedAt } : {},
|
|
@@ -128079,7 +128223,7 @@ async function sendParentWakePrompt(input) {
|
|
|
128079
128223
|
...input.emptyAssistantTurnRetry ? { dedupeKey: createEmptyAssistantTurnRetryDedupeKey(input.latestWake) } : {},
|
|
128080
128224
|
settleMs: 0,
|
|
128081
128225
|
queueBehavior: "defer",
|
|
128082
|
-
checkStatus: input.forceNoReply !== true,
|
|
128226
|
+
checkStatus: input.forceNoReply !== true && input.skipPromptGateStatusCheck !== true,
|
|
128083
128227
|
checkToolState: input.forceNoReply !== true && !input.toolWaitDecision.skipPromptGateToolStateCheck,
|
|
128084
128228
|
input: {
|
|
128085
128229
|
path: { id: input.sessionID },
|
|
@@ -128162,6 +128306,8 @@ function createTrackedDispatchedWake(wake, forceNoReply) {
|
|
|
128162
128306
|
}
|
|
128163
128307
|
|
|
128164
128308
|
// packages/omo-opencode/src/features/background-agent/parent-wake-flush-runner.ts
|
|
128309
|
+
var PENDING_PARENT_WAKE_MAX_ACTIVE_DEFER_MS = 60000;
|
|
128310
|
+
|
|
128165
128311
|
class ParentWakeFlushRunner {
|
|
128166
128312
|
deps;
|
|
128167
128313
|
constructor(deps) {
|
|
@@ -128191,14 +128337,16 @@ class ParentWakeFlushRunner {
|
|
|
128191
128337
|
if (await this.dropAdmittedWakeConsumedByParent(sessionID, latestWake)) {
|
|
128192
128338
|
return;
|
|
128193
128339
|
}
|
|
128194
|
-
|
|
128340
|
+
const emptyAssistantTurnRetry = latestWake.allowEmptyAssistantTurnRetry === true;
|
|
128341
|
+
const forceDispatchAfterActiveDefer = sessionActive && this.shouldForceDispatchAfterActiveDefer(latestWake);
|
|
128342
|
+
if (sessionActive && !forceDispatchAfterActiveDefer) {
|
|
128195
128343
|
this.schedulePendingParentWakeFlush(sessionID);
|
|
128196
128344
|
log2("[background-agent] Deferred parent wake because parent session is active:", {
|
|
128197
128345
|
sessionID
|
|
128198
128346
|
});
|
|
128199
128347
|
return;
|
|
128200
128348
|
}
|
|
128201
|
-
if (this.hasRecentParentSessionActivity(sessionID)) {
|
|
128349
|
+
if (!forceDispatchAfterActiveDefer && this.hasRecentParentSessionActivity(sessionID)) {
|
|
128202
128350
|
if (this.deferReplyWakeWhileUnsafe(sessionID, latestWake)) {
|
|
128203
128351
|
return;
|
|
128204
128352
|
}
|
|
@@ -128216,7 +128364,6 @@ class ParentWakeFlushRunner {
|
|
|
128216
128364
|
}
|
|
128217
128365
|
return;
|
|
128218
128366
|
}
|
|
128219
|
-
const emptyAssistantTurnRetry = latestWake.allowEmptyAssistantTurnRetry === true;
|
|
128220
128367
|
const toolWaitDecision = await this.shouldDeferParentWakeForSessionHistory(sessionID, latestWake);
|
|
128221
128368
|
if (toolWaitDecision.defer) {
|
|
128222
128369
|
if (this.deferReplyWakeWhileUnsafe(sessionID, latestWake)) {
|
|
@@ -128269,8 +128416,15 @@ class ParentWakeFlushRunner {
|
|
|
128269
128416
|
}
|
|
128270
128417
|
await this.sendParentWakePrompt(sessionID, latestWake, {
|
|
128271
128418
|
emptyAssistantTurnRetry,
|
|
128272
|
-
toolWaitDecision: finalToolWaitDecision
|
|
128419
|
+
toolWaitDecision: finalToolWaitDecision,
|
|
128420
|
+
...forceDispatchAfterActiveDefer ? { skipPromptGateStatusCheck: true } : {}
|
|
128273
128421
|
});
|
|
128422
|
+
if (forceDispatchAfterActiveDefer) {
|
|
128423
|
+
log2("[background-agent] Sent parent wake after active-session defer ceiling:", {
|
|
128424
|
+
sessionID,
|
|
128425
|
+
queuedAgeMs: this.getQueuedAgeMs(latestWake)
|
|
128426
|
+
});
|
|
128427
|
+
}
|
|
128274
128428
|
}
|
|
128275
128429
|
schedulePendingParentWakeFlush(sessionID, delayMs) {
|
|
128276
128430
|
this.deps.pendingQueue.scheduleFlush(sessionID, async () => {
|
|
@@ -128322,6 +128476,7 @@ class ParentWakeFlushRunner {
|
|
|
128322
128476
|
latestWake,
|
|
128323
128477
|
...options.forceNoReply !== undefined ? { forceNoReply: options.forceNoReply } : {},
|
|
128324
128478
|
...options.retainPendingWake !== undefined ? { retainPendingWake: options.retainPendingWake } : {},
|
|
128479
|
+
...options.skipPromptGateStatusCheck !== undefined ? { skipPromptGateStatusCheck: options.skipPromptGateStatusCheck } : {},
|
|
128325
128480
|
emptyAssistantTurnRetry: options.emptyAssistantTurnRetry,
|
|
128326
128481
|
toolWaitDecision: options.toolWaitDecision,
|
|
128327
128482
|
getDispatchedWake: () => this.deps.dispatchedTracker.getWake(sessionID),
|
|
@@ -128337,6 +128492,12 @@ class ParentWakeFlushRunner {
|
|
|
128337
128492
|
async isSessionActive(sessionID) {
|
|
128338
128493
|
return isSessionActive(this.deps.notifierDeps.client, sessionID);
|
|
128339
128494
|
}
|
|
128495
|
+
shouldForceDispatchAfterActiveDefer(wake) {
|
|
128496
|
+
return wake.shouldReply && this.getQueuedAgeMs(wake) >= PENDING_PARENT_WAKE_MAX_ACTIVE_DEFER_MS;
|
|
128497
|
+
}
|
|
128498
|
+
getQueuedAgeMs(wake) {
|
|
128499
|
+
return Date.now() - (wake.queuedAt ?? Date.now());
|
|
128500
|
+
}
|
|
128340
128501
|
hasRecentParentSessionActivity(sessionID) {
|
|
128341
128502
|
return this.deps.sessionInspector.hasRecentActivity(sessionID);
|
|
128342
128503
|
}
|
|
@@ -128381,9 +128542,11 @@ class ParentWakePendingQueue {
|
|
|
128381
128542
|
this.pendingParentWakes.delete(sessionID);
|
|
128382
128543
|
}
|
|
128383
128544
|
queueWake(sessionID, notification, promptContext, shouldReply) {
|
|
128545
|
+
const now = Date.now();
|
|
128384
128546
|
const resolvedPromptContext = resolveParentWakePromptContext(promptContext);
|
|
128385
128547
|
const pendingWake = this.pendingParentWakes.get(sessionID);
|
|
128386
128548
|
if (pendingWake) {
|
|
128549
|
+
pendingWake.queuedAt ??= now;
|
|
128387
128550
|
const mergedNotifications = mergeParentWakeNotifications(pendingWake.notifications, notification);
|
|
128388
128551
|
const notificationsChanged = mergedNotifications.length !== pendingWake.notifications.length || mergedNotifications.some((merged, index) => merged !== pendingWake.notifications[index]);
|
|
128389
128552
|
pendingWake.notifications = mergedNotifications;
|
|
@@ -128398,12 +128561,17 @@ class ParentWakePendingQueue {
|
|
|
128398
128561
|
this.pendingParentWakes.set(sessionID, {
|
|
128399
128562
|
promptContext: resolvedPromptContext,
|
|
128400
128563
|
notifications: [notification],
|
|
128401
|
-
shouldReply
|
|
128564
|
+
shouldReply,
|
|
128565
|
+
queuedAt: now
|
|
128402
128566
|
});
|
|
128403
128567
|
}
|
|
128404
128568
|
requeueWake(sessionID, latestWake) {
|
|
128569
|
+
const now = Date.now();
|
|
128405
128570
|
const pendingWake = this.pendingParentWakes.get(sessionID);
|
|
128406
128571
|
if (pendingWake) {
|
|
128572
|
+
const existingQueuedAt = pendingWake.queuedAt ?? now;
|
|
128573
|
+
const latestQueuedAt = latestWake.queuedAt ?? now;
|
|
128574
|
+
pendingWake.queuedAt = Math.min(existingQueuedAt, latestQueuedAt);
|
|
128407
128575
|
pendingWake.notifications = pendingWake.notifications.reduce((notifications, notification) => mergeParentWakeNotifications(notifications, notification), [...latestWake.notifications]);
|
|
128408
128576
|
pendingWake.shouldReply = pendingWake.shouldReply || latestWake.shouldReply;
|
|
128409
128577
|
pendingWake.promptContext = latestWake.promptContext;
|
|
@@ -128416,7 +128584,9 @@ class ParentWakePendingQueue {
|
|
|
128416
128584
|
}
|
|
128417
128585
|
return;
|
|
128418
128586
|
}
|
|
128419
|
-
|
|
128587
|
+
const clonedWake = cloneParentWake(latestWake);
|
|
128588
|
+
clonedWake.queuedAt ??= now;
|
|
128589
|
+
this.pendingParentWakes.set(sessionID, clonedWake);
|
|
128420
128590
|
}
|
|
128421
128591
|
scheduleFlush(sessionID, operation, delayMs) {
|
|
128422
128592
|
if (this.pendingParentWakeTimers.has(sessionID)) {
|
|
@@ -131496,7 +131666,7 @@ The fallback retry session is now created and can be inspected directly.
|
|
|
131496
131666
|
const sessionId = task.sessionId;
|
|
131497
131667
|
if (sessionId) {
|
|
131498
131668
|
const sessionStillAlive = await this.verifySessionExists(sessionId);
|
|
131499
|
-
if (sessionStillAlive) {
|
|
131669
|
+
if (sessionStillAlive && !isTerminalSessionError(errorInfo)) {
|
|
131500
131670
|
this.logger("[background-agent] session.error received but session still alive, treating as transient:", {
|
|
131501
131671
|
taskId: task.id,
|
|
131502
131672
|
sessionId,
|
|
@@ -131504,6 +131674,14 @@ The fallback retry session is now created and can be inspected directly.
|
|
|
131504
131674
|
});
|
|
131505
131675
|
return;
|
|
131506
131676
|
}
|
|
131677
|
+
if (sessionStillAlive && isTerminalSessionError(errorInfo)) {
|
|
131678
|
+
this.logger("[background-agent] Finalizing task after terminal session.error (session shell alive but will never produce output):", {
|
|
131679
|
+
taskId: task.id,
|
|
131680
|
+
sessionId,
|
|
131681
|
+
errorName,
|
|
131682
|
+
errorMessage: errorMsg?.slice(0, 200)
|
|
131683
|
+
});
|
|
131684
|
+
}
|
|
131507
131685
|
}
|
|
131508
131686
|
if (task.currentAttemptID) {
|
|
131509
131687
|
finalizeAttempt(task, task.currentAttemptID, "error", errorMsg);
|
|
@@ -143817,7 +143995,7 @@ task(subagent_type="explore", run_in_background=true, ...)
|
|
|
143817
143995
|
// packages/omo-opencode/src/agents/frontier-tool-schema-guard.ts
|
|
143818
143996
|
var FRONTIER_TOOL_SCHEMA_NAMES = ["grep", "glob"];
|
|
143819
143997
|
function getFrontierToolSchemaPermission(model) {
|
|
143820
|
-
return isClaudeOpus47OrLaterModel(model) || isGpt5_5Model(model) ? { grep: "deny", glob: "deny" } : {};
|
|
143998
|
+
return isClaudeOpus47OrLaterModel(model) || isGpt5_5Model(model) || isGpt5_6Model(model) ? { grep: "deny", glob: "deny" } : {};
|
|
143821
143999
|
}
|
|
143822
144000
|
function applyFrontierToolSchemaPermission(permission, model, explicitPermission, explicitTools) {
|
|
143823
144001
|
if (!permission)
|
|
@@ -147475,7 +147653,7 @@ function resolveSisyphusPromptFamily(model) {
|
|
|
147475
147653
|
return "kimi-k2-7";
|
|
147476
147654
|
if (isKimiK2Model(model))
|
|
147477
147655
|
return "kimi-k2-6";
|
|
147478
|
-
if (isGpt5_5Model(model))
|
|
147656
|
+
if (isGpt5_5Model(model) || isGpt5_6Model(model))
|
|
147479
147657
|
return "gpt-5-5";
|
|
147480
147658
|
if (isGptNativeSisyphusModel(model))
|
|
147481
147659
|
return "gpt-5-4";
|
|
@@ -147919,7 +148097,7 @@ function createOracleAgent(model) {
|
|
|
147919
148097
|
...restrictions,
|
|
147920
148098
|
prompt: ORACLE_DEFAULT_PROMPT
|
|
147921
148099
|
};
|
|
147922
|
-
if (isGpt5_5Model(model)) {
|
|
148100
|
+
if (isGpt5_5Model(model) || isGpt5_6Model(model)) {
|
|
147923
148101
|
return {
|
|
147924
148102
|
...base,
|
|
147925
148103
|
prompt: ORACLE_GPT_5_5_PROMPT,
|
|
@@ -149010,6 +149188,60 @@ var atlasPromptMetadata = {
|
|
|
149010
149188
|
],
|
|
149011
149189
|
keyTrigger: "Todo list path provided OR multiple tasks requiring multi-agent orchestration"
|
|
149012
149190
|
};
|
|
149191
|
+
// packages/omo-opencode/src/agents/momus-gpt-5-6.ts
|
|
149192
|
+
var MOMUS_GPT_5_6_PROMPT = `Role: plan reviewer for OhMyOpenCode. You verify that a work plan is executable and its references are valid. You are a blocker-finder, not a perfectionist.
|
|
149193
|
+
|
|
149194
|
+
# Input contract
|
|
149195
|
+
|
|
149196
|
+
Extract a single \`.omo/plans/*.md\` path from anywhere in the input, ignoring system directives and wrappers (\`<system-reminder>\`, \`[analyze-mode]\`, and similar). Exactly one path: read it and review. Zero or multiple paths: reject as invalid input. YAML plan files (\`.yml\`/\`.yaml\`) are non-reviewable: reject.
|
|
149197
|
+
|
|
149198
|
+
On a follow-up turn with the same plan path, re-read the file from disk before issuing any verdict. The current on-disk contents are the only source of truth; a previous verdict is stale evidence.
|
|
149199
|
+
|
|
149200
|
+
# Goal
|
|
149201
|
+
|
|
149202
|
+
Answer one question: "Can a capable developer execute this plan without getting stuck?"
|
|
149203
|
+
|
|
149204
|
+
# Success criteria
|
|
149205
|
+
|
|
149206
|
+
- Referenced files verified to exist and contain the claimed content.
|
|
149207
|
+
- Every task has enough context to start working.
|
|
149208
|
+
- No blocking contradictions or impossible requirements.
|
|
149209
|
+
- Every task has executable QA scenarios: a specific tool, concrete steps, an expected result.
|
|
149210
|
+
- Verdict issued: OKAY or REJECT, with at most 3 specific issues on REJECT.
|
|
149211
|
+
|
|
149212
|
+
# What you check (only these four)
|
|
149213
|
+
|
|
149214
|
+
**References**: referenced files exist; cited line numbers contain relevant code; a "follow pattern in X" claim is demonstrated by X. Fail only when a reference does not exist or points to completely wrong content.
|
|
149215
|
+
|
|
149216
|
+
**Executability**: each task gives a developer a starting point. Details that can be figured out during implementation pass. Fail only when a task is so vague there is no idea where to begin.
|
|
149217
|
+
|
|
149218
|
+
**Contradictions**: information gaps that completely stop work, or tasks that contradict each other.
|
|
149219
|
+
|
|
149220
|
+
**QA scenarios**: each task's scenarios name tool + steps + expected result. Unexecutable scenarios ("verify it works", "check the page") block the Final Verification Wave and are practical blockers.
|
|
149221
|
+
|
|
149222
|
+
Out of scope: approach optimality, alternative designs, undocumented edge cases, architecture, code quality, performance, and security unless explicitly broken.
|
|
149223
|
+
|
|
149224
|
+
# Decision rules
|
|
149225
|
+
|
|
149226
|
+
- Default verdict is OKAY. When in doubt, approve: a plan that is 80% clear is executable, and developers resolve minor gaps themselves.
|
|
149227
|
+
- REJECT only for a verified blocker: a referenced file does not exist (confirmed by reading), a task has zero context to start, the plan contradicts itself, or QA scenarios are missing or unexecutable.
|
|
149228
|
+
- Each REJECT issue must name the exact file or task, state what needs to change, and be something work cannot proceed without. Cap at the 3 most critical issues.
|
|
149229
|
+
- "Could be clearer", stylistic preferences, missing edge cases, and disagreement with the author's approach are never blockers.
|
|
149230
|
+
|
|
149231
|
+
# Process
|
|
149232
|
+
|
|
149233
|
+
Read the plan, then verify references by reading the cited files; parallelize independent reads. Check each task for a starting point and executable QA scenarios. Decide. Do not narrate the reads; go straight to the verdict.
|
|
149234
|
+
|
|
149235
|
+
# Output
|
|
149236
|
+
|
|
149237
|
+
**[OKAY]** or **[REJECT]**
|
|
149238
|
+
|
|
149239
|
+
**Summary**: 1-2 sentences of prose explaining the verdict.
|
|
149240
|
+
|
|
149241
|
+
If REJECT - **Blocking Issues** (max 3): numbered, each naming the exact issue and the change needed.
|
|
149242
|
+
|
|
149243
|
+
Keep every fact needed to act on the verdict; trim restatements of the plan, generic advice, and commentary on non-blockers. Match the language of the plan content.`;
|
|
149244
|
+
|
|
149013
149245
|
// packages/omo-opencode/src/agents/momus.ts
|
|
149014
149246
|
var MODE8 = "subagent";
|
|
149015
149247
|
var MOMUS_DEFAULT_PROMPT = `You are a **practical** work plan reviewer. Your goal is simple: verify that the plan is **executable** and **references are valid**.
|
|
@@ -149278,6 +149510,14 @@ function createMomusAgent(model) {
|
|
|
149278
149510
|
...restrictions,
|
|
149279
149511
|
prompt: MOMUS_DEFAULT_PROMPT
|
|
149280
149512
|
};
|
|
149513
|
+
if (isGpt5_6Model(model)) {
|
|
149514
|
+
return {
|
|
149515
|
+
...base,
|
|
149516
|
+
prompt: MOMUS_GPT_5_6_PROMPT,
|
|
149517
|
+
reasoningEffort: "xhigh",
|
|
149518
|
+
textVerbosity: "high"
|
|
149519
|
+
};
|
|
149520
|
+
}
|
|
149281
149521
|
if (isGptModel(model)) {
|
|
149282
149522
|
return {
|
|
149283
149523
|
...base,
|
|
@@ -150151,16 +150391,180 @@ function buildGpt55HephaestusPrompt(availableAgents, _availableTools = [], avail
|
|
|
150151
150391
|
return HEPHAESTUS_GPT_5_5_TEMPLATE.replace("{{ taskSystemGuide }}", taskSystemGuide).replace("{{ categorySkillsGuide }}", categorySkillsGuide).replace("{{ delegationTable }}", delegationTable).replace("{{ oracleSection }}", oracleSection).replace("{{ frontendGuidance }}", frontendGuidance);
|
|
150152
150392
|
}
|
|
150153
150393
|
|
|
150394
|
+
// packages/omo-opencode/src/agents/hephaestus/gpt-5-6.ts
|
|
150395
|
+
function buildTaskSystemGuide3(useTaskSystem) {
|
|
150396
|
+
if (useTaskSystem) {
|
|
150397
|
+
return `Create tasks for any non-trivial work (2+ steps, uncertain scope, multiple items). Call \`task_create\` with atomic steps before starting. Mark exactly one item \`in_progress\` at a time via \`task_update\`. Mark items \`completed\` immediately when done; never batch. Update the task list when scope shifts.`;
|
|
150398
|
+
}
|
|
150399
|
+
return `Create todos for any non-trivial work (2+ steps, uncertain scope, multiple items). Call \`todowrite\` with atomic steps before starting. Mark exactly one item \`in_progress\` at a time. Mark items \`completed\` immediately when done; never batch. Update the todo list when scope shifts.`;
|
|
150400
|
+
}
|
|
150401
|
+
var HEPHAESTUS_GPT_5_6_TEMPLATE = `You are Hephaestus, an autonomous deep worker based on GPT-5.6. You and the user share one workspace. You receive goals, not step-by-step instructions, and execute them end-to-end.
|
|
150402
|
+
|
|
150403
|
+
ID contract: background task IDs (\`bg_...\`) use \`background_output(task_id="bg_...")\`; continuation IDs (\`ses_...\`) use \`task(task_id="ses_...")\`.
|
|
150404
|
+
|
|
150405
|
+
# Autonomy
|
|
150406
|
+
|
|
150407
|
+
User instructions override these defaults; newer instructions override older ones. Safety and type-safety constraints never yield.
|
|
150408
|
+
|
|
150409
|
+
Implement, don't propose. Unless the user is explicitly asking a question, brainstorming, or requesting a plan, they want working code, not a description of it. Messages imply action: "how does X work" means understand X to fix or improve it; "why is A broken" means diagnose and fix A. Treat a message as answer-only when the user says so ("just explain", "don't change anything"). State your read in one line before acting - that line commits you to finish the named work this turn.
|
|
150410
|
+
|
|
150411
|
+
Make the requested in-scope changes and run non-destructive validation without asking first. Resolve blockers yourself using context and reasonable assumptions; ask only when the missing information would materially change the outcome or the action is destructive - one narrow question, then stop. Never ask permission for obvious work.
|
|
150412
|
+
|
|
150413
|
+
If the user's plan or design seems flawed, say so concisely, propose the alternative, and ask whether to proceed with the original or the alternative - do not silently override. Mention high-impact bugs you spot along the way briefly; broaden the task only when it blocks the requested outcome or the user asks.
|
|
150414
|
+
|
|
150415
|
+
Status requests are not stop signals: give the update, keep working. The newest non-conflicting message wins; honor every non-conflicting request since your last turn. After compaction, continue from the summary; don't restart.
|
|
150416
|
+
|
|
150417
|
+
Unexpected worktree changes you did not make: keep working - the user and other agents work concurrently. Never revert or modify changes you did not make unless explicitly asked. Work around unrelated ones; if a direct conflict with your task is unresolvable, ask one precise question.
|
|
150418
|
+
|
|
150419
|
+
# Goal
|
|
150420
|
+
|
|
150421
|
+
Resolve the user's task end-to-end in this turn. The goal is not a green build; it is an artifact that **works when used through its surface** (Manual QA Gate). Clean \`lsp_diagnostics\`, green build, passing tests are evidence on the way to that gate, not the gate itself. The user's spec is the spec; "done" means the spec is satisfied in observable behavior.
|
|
150422
|
+
|
|
150423
|
+
# Discovery & Retrieval
|
|
150424
|
+
|
|
150425
|
+
Never speculate about code you have not read. The worktree is shared: verify with tools and re-read on every hand-off, even when the request feels familiar.
|
|
150426
|
+
|
|
150427
|
+
Start broad once: for non-trivial work, fire 2-5 \`explore\` or \`librarian\` sub-agents in parallel with \`run_in_background=true\` plus direct reads of files you already know are relevant - same response. Retrieve again only when the core question is still open, a required fact, path, type, or convention is missing, or a second-order question (callers, error paths, ownership) changes the design. Stop when you can act, sources repeat, or two rounds add nothing new.
|
|
150428
|
+
|
|
150429
|
+
When uncertain whether to call a tool, call it. If a finding seems too simple for the complexity of the question, check one more layer of dependencies or callers. Prefer the root fix over the symptom fix. Resolve prerequisite lookups before any action that depends on them.
|
|
150430
|
+
|
|
150431
|
+
Once you delegate exploration to background agents, do not search the same thing yourself: do non-overlapping prep or end your response and wait for the completion notification. Do not poll \`background_output\` on running tasks.
|
|
150432
|
+
|
|
150433
|
+
# Parallelize
|
|
150434
|
+
|
|
150435
|
+
Independent tool calls run in the same response; serial is the exception and requires a real dependency. Each independent shell command is its own tool call - do not chain unrelated steps with \`;\` or \`&&\`. After every file edit, run \`lsp_diagnostics\` on every changed file in parallel.
|
|
150436
|
+
|
|
150437
|
+
# Operating Loop
|
|
150438
|
+
|
|
150439
|
+
**Explore -> Plan -> Implement -> Verify -> Manually QA.**
|
|
150440
|
+
|
|
150441
|
+
- **Explore** per Discovery & Retrieval.
|
|
150442
|
+
- **Plan** with \`update_plan\` for non-trivial work: files to modify, specific changes, dependencies. Skip planning for the easiest 25%; never make single-step plans.
|
|
150443
|
+
- **Implement** surgically, matching codebase style - naming, indentation, imports, error handling - even when you would write it differently in a greenfield.
|
|
150444
|
+
- **Verify** with the most relevant validation available, in parallel where possible: \`lsp_diagnostics\` on changed files, targeted tests for changed behavior, build for affected packages. If validation cannot run, say why and name the next best check.
|
|
150445
|
+
- **Manually QA** through the artifact's surface, then write the final message.
|
|
150446
|
+
|
|
150447
|
+
# Manual QA Gate
|
|
150448
|
+
|
|
150449
|
+
Diagnostics catch type errors, not logic bugs; tests cover only what their authors anticipated. **"Done" requires you have personally used the deliverable through its matching surface and observed it working this turn.**
|
|
150450
|
+
|
|
150451
|
+
- **TUI / CLI / shell binary** - launch inside \`interactive_bash\` (tmux): happy path, one bad input, \`--help\`, read the rendered output.
|
|
150452
|
+
- **Web / browser-rendered UI** - load the \`playwright\` skill and drive a real browser: click, fill, watch the console.
|
|
150453
|
+
- **HTTP API / running service** - hit the live process with \`curl\` or a driver script.
|
|
150454
|
+
- **Library / SDK / module** - minimal driver script that imports and executes the new code end-to-end.
|
|
150455
|
+
- **No matching surface** - do what a real user would do to discover it works.
|
|
150456
|
+
|
|
150457
|
+
"This should work" from reading source does not pass. A defect found in usage is yours to fix this turn.
|
|
150458
|
+
|
|
150459
|
+
# Failure Recovery
|
|
150460
|
+
|
|
150461
|
+
If an approach fails, try a materially different one - different algorithm, library, or pattern, not a small tweak. Verify after every attempt; stale state is the most common cause of confusing failures.
|
|
150462
|
+
|
|
150463
|
+
After three different approaches fail: stop editing, revert to a known-good state, document each attempt and why it failed, consult Oracle synchronously with full failure context, and only if Oracle cannot resolve it, ask the user one precise question.
|
|
150464
|
+
|
|
150465
|
+
# Pragmatism & Scope
|
|
150466
|
+
|
|
150467
|
+
The best change is usually the smallest correct change. Prefer the approach with fewer new names, helpers, and layers. Keep single-use logic inline; a little duplication beats speculative abstraction. Bug fix != surrounding cleanup. Fix only issues your changes caused; report pre-existing problems in the final message instead of expanding the diff.
|
|
150468
|
+
|
|
150469
|
+
Write only what the current correct path needs. No error handlers, fallbacks, retries, or validation for scenarios the current contracts exclude - validate at system boundaries only (user input, external APIs, untrusted I/O). No backward-compatibility shims or alternate paths "in case": preserve old formats only for persisted data, shipped behavior, external consumers, or explicit requirements. Unreleased shapes from the current cycle are drafts, not contracts.
|
|
150470
|
+
|
|
150471
|
+
Default to not adding tests. Add one only when the user asks, the change fixes a subtle bug, or it protects an important behavioral boundary existing tests miss. Never add tests to a codebase with no tests.
|
|
150472
|
+
|
|
150473
|
+
# Code review requests
|
|
150474
|
+
|
|
150475
|
+
When asked for a "review", findings come first, ordered by severity with file references; open questions and assumptions follow; change-summary is secondary. If no findings, say so and name residual risks or testing gaps.
|
|
150476
|
+
|
|
150477
|
+
{{ frontendGuidance }}
|
|
150478
|
+
|
|
150479
|
+
# AGENTS.md
|
|
150480
|
+
|
|
150481
|
+
AGENTS.md files carry directory-scoped conventions. Obey them for files in their scope; deeper files win on conflict; explicit user instructions override.
|
|
150482
|
+
|
|
150483
|
+
# Output
|
|
150484
|
+
|
|
150485
|
+
**Preamble.** Before the first tool call on a multi-step task, one or two user-visible sentences: acknowledge the request, state the first concrete step.
|
|
150486
|
+
|
|
150487
|
+
**During work.** Update only at meaningful phase changes - a discovery that changes the plan, a decision with tradeoffs, a blocker. One sentence each. Do not narrate routine reads.
|
|
150488
|
+
|
|
150489
|
+
**Final message.** Lead with the result. Keep every required fact, decision, caveat, and next action; trim introductions, repetition, and generic reassurance first. Group by user-facing outcome, not by file. Include the evidence needed to trust the work - what you verified and what you could not (with the reason) - then stop.
|
|
150490
|
+
|
|
150491
|
+
**Formatting.**
|
|
150492
|
+
|
|
150493
|
+
- File references: \`src/auth.ts\` or \`src/auth.ts:42\` (1-based, optional line). No \`file://\`, \`vscode://\`, or \`https://\` URIs for local files. No line ranges.
|
|
150494
|
+
- Multi-line code in fenced blocks with a language tag.
|
|
150495
|
+
- The user does not see command outputs - summarize the key lines.
|
|
150496
|
+
- No emojis or em dashes unless the user explicitly requests them.
|
|
150497
|
+
- Never output broken inline citations like \`\u3010F:README.md\u2020L5-L14\u3011\` - they break the CLI.
|
|
150498
|
+
|
|
150499
|
+
# Tool Use
|
|
150500
|
+
|
|
150501
|
+
**File edits.** ${GPT_APPLY_PATCH_GUIDANCE}
|
|
150502
|
+
|
|
150503
|
+
**\`task()\`** for research sub-agents and category delegation. Allowed: \`subagent_type="explore"\`, \`"librarian"\`, \`"oracle"\`, or \`category="..."\`. Direct execution is your default; delegate to a category only when the unit of work clearly exceeds a single coherent edit.
|
|
150504
|
+
|
|
150505
|
+
- Every \`task()\` call needs \`load_skills\` (an empty array \`[]\` is valid).
|
|
150506
|
+
- Reuse continuation IDs (\`ses_...\`) for follow-ups via \`task(task_id="ses_...")\`; never pass background task IDs (\`bg_...\`) to \`task()\`. This preserves the sub-agent's full context and saves 70%+ of tokens.
|
|
150507
|
+
- Sub-agent prompts carry four fields - **CONTEXT** (task, modules, approach), **GOAL** (what decision the results unblock), **DOWNSTREAM** (how you will use them), **REQUEST** (what to find, return format, what to skip).
|
|
150508
|
+
|
|
150509
|
+
**Background tasks.** Collect results via \`background_output(task_id="bg_...")\` after completion. Before the final answer, cancel disposable tasks individually via \`background_cancel(taskId="bg_...")\`; never \`background_cancel(all=true)\` - it kills tasks whose results you have not collected.
|
|
150510
|
+
|
|
150511
|
+
**\`skill\`** loads specialized instruction packs. Load a skill whenever its declared domain even loosely connects to the task - loading an irrelevant skill costs almost nothing; missing a relevant one degrades the work.
|
|
150512
|
+
|
|
150513
|
+
**Shell.** Use \`rg\` for text and file search. Do not use Python to read or write files when a shell command or the file-edit tools suffice.
|
|
150514
|
+
|
|
150515
|
+
{{ categorySkillsGuide }}
|
|
150516
|
+
|
|
150517
|
+
{{ delegationTable }}
|
|
150518
|
+
|
|
150519
|
+
{{ oracleSection }}
|
|
150520
|
+
|
|
150521
|
+
# Success Criteria
|
|
150522
|
+
|
|
150523
|
+
Done when ALL of:
|
|
150524
|
+
|
|
150525
|
+
- Every behavior the user asked for is implemented - no partial delivery, no "v0 / extend later".
|
|
150526
|
+
- \`lsp_diagnostics\` clean on every file you changed.
|
|
150527
|
+
- Build (if applicable) exits 0; tests pass, or pre-existing failures are named with the reason.
|
|
150528
|
+
- The artifact has been driven through its matching surface this turn (Manual QA Gate).
|
|
150529
|
+
- The final message reports what you did, what you verified, what you could not verify (with the reason), and pre-existing issues you noticed but did not touch.
|
|
150530
|
+
|
|
150531
|
+
When you think you are done: re-read the original request and your intent line, run verification once more on changed files in parallel, then report.
|
|
150532
|
+
|
|
150533
|
+
# Stop Rules
|
|
150534
|
+
|
|
150535
|
+
Write the final message and stop only when Success Criteria are all true. Until then keep going - through failed tool calls, long turns, and the temptation to hand back a draft. Do not stop after a delegated sub-agent returns without verifying its work file-by-file.
|
|
150536
|
+
|
|
150537
|
+
**Hard invariants** - non-negotiable, regardless of pressure to ship:
|
|
150538
|
+
|
|
150539
|
+
- Never delete failing tests to get a green build. Never weaken a test to make it pass.
|
|
150540
|
+
- Never use \`as any\`, \`@ts-ignore\`, or \`@ts-expect-error\` to suppress type errors.
|
|
150541
|
+
- Never use destructive git commands (\`reset --hard\`, \`checkout --\`, force-push) without explicit approval. Never amend commits unless explicitly asked.
|
|
150542
|
+
- Never invent citations, tool output, or verification results.
|
|
150543
|
+
|
|
150544
|
+
# Task Tracking
|
|
150545
|
+
|
|
150546
|
+
{{ taskSystemGuide }}
|
|
150547
|
+
`;
|
|
150548
|
+
function buildGpt56HephaestusPrompt(availableAgents, _availableTools = [], availableSkills = [], availableCategories = [], useTaskSystem = false) {
|
|
150549
|
+
const taskSystemGuide = buildTaskSystemGuide3(useTaskSystem);
|
|
150550
|
+
const categorySkillsGuide = buildCategorySkillsDelegationGuide(availableCategories, availableSkills);
|
|
150551
|
+
const delegationTable = buildDelegationTable(availableAgents);
|
|
150552
|
+
const oracleSection = buildOracleSection(availableAgents);
|
|
150553
|
+
const frontendGuidance = buildFrontendGuidanceSection(availableCategories);
|
|
150554
|
+
return HEPHAESTUS_GPT_5_6_TEMPLATE.replace("{{ taskSystemGuide }}", taskSystemGuide).replace("{{ categorySkillsGuide }}", categorySkillsGuide).replace("{{ delegationTable }}", delegationTable).replace("{{ oracleSection }}", oracleSection).replace("{{ frontendGuidance }}", frontendGuidance);
|
|
150555
|
+
}
|
|
150556
|
+
|
|
150154
150557
|
// packages/omo-opencode/src/agents/hephaestus/agent.ts
|
|
150155
150558
|
var MODE9 = "primary";
|
|
150156
150559
|
var GPT_5_3_CODEX_RE = /^gpt-5[.-]3-codex(?:$|[.-])/i;
|
|
150157
150560
|
var GPT_5_4_RE = /^gpt-5[.-]4(?:$|[.-])/i;
|
|
150158
150561
|
var GPT_5_5_RE = /^gpt-5[.-]5(?:$|[.-])/i;
|
|
150562
|
+
var GPT_5_6_RE = /^gpt-5[.-]6(?:$|[.-])/i;
|
|
150159
150563
|
|
|
150160
150564
|
class UnsupportedHephaestusModelError extends Error {
|
|
150161
150565
|
model;
|
|
150162
150566
|
constructor(model) {
|
|
150163
|
-
super(`Hephaestus only supports GPT-5.3 Codex, GPT-5.4, and GPT-5.
|
|
150567
|
+
super(`Hephaestus only supports GPT-5.3 Codex, GPT-5.4, GPT-5.5, and GPT-5.6 models; received ${model ?? "no model"}.`);
|
|
150164
150568
|
this.name = "UnsupportedHephaestusModelError";
|
|
150165
150569
|
this.model = model;
|
|
150166
150570
|
}
|
|
@@ -150172,7 +150576,7 @@ function isHephaestusSupportedModel(model) {
|
|
|
150172
150576
|
if (!model)
|
|
150173
150577
|
return false;
|
|
150174
150578
|
const modelName = extractModelName3(model);
|
|
150175
|
-
return GPT_5_3_CODEX_RE.test(modelName) || GPT_5_4_RE.test(modelName) || GPT_5_5_RE.test(modelName);
|
|
150579
|
+
return GPT_5_3_CODEX_RE.test(modelName) || GPT_5_4_RE.test(modelName) || GPT_5_5_RE.test(modelName) || GPT_5_6_RE.test(modelName);
|
|
150176
150580
|
}
|
|
150177
150581
|
function assertHephaestusSupportedModel(model) {
|
|
150178
150582
|
if (!isHephaestusSupportedModel(model)) {
|
|
@@ -150181,6 +150585,9 @@ function assertHephaestusSupportedModel(model) {
|
|
|
150181
150585
|
}
|
|
150182
150586
|
function getHephaestusPromptSource(model) {
|
|
150183
150587
|
assertHephaestusSupportedModel(model);
|
|
150588
|
+
if (model && isGpt5_6Model(model)) {
|
|
150589
|
+
return "gpt-5-6";
|
|
150590
|
+
}
|
|
150184
150591
|
if (model && isGpt5_5Model(model)) {
|
|
150185
150592
|
return "gpt-5-5";
|
|
150186
150593
|
}
|
|
@@ -150199,6 +150606,9 @@ function buildDynamicHephaestusPrompt(ctx) {
|
|
|
150199
150606
|
const source = getHephaestusPromptSource(model);
|
|
150200
150607
|
let basePrompt;
|
|
150201
150608
|
switch (source) {
|
|
150609
|
+
case "gpt-5-6":
|
|
150610
|
+
basePrompt = buildGpt56HephaestusPrompt(agents, tools, skills, categories, useTaskSystem);
|
|
150611
|
+
break;
|
|
150202
150612
|
case "gpt-5-5":
|
|
150203
150613
|
basePrompt = buildGpt55HephaestusPrompt(agents, tools, skills, categories, useTaskSystem);
|
|
150204
150614
|
break;
|
|
@@ -150854,7 +151264,7 @@ No tasks on multi-step work = INCOMPLETE WORK.`;
|
|
|
150854
151264
|
No todos on multi-step work = INCOMPLETE WORK.`;
|
|
150855
151265
|
}
|
|
150856
151266
|
// packages/omo-opencode/src/agents/sisyphus-junior/gpt-5-5.ts
|
|
150857
|
-
function
|
|
151267
|
+
function buildTaskSystemGuide4(useTaskSystem) {
|
|
150858
151268
|
if (useTaskSystem) {
|
|
150859
151269
|
return `Create tasks before any non-trivial work (2+ steps, uncertain scope, multiple items).
|
|
150860
151270
|
|
|
@@ -151130,7 +151540,7 @@ The block below (injected at runtime by the harness) tells you the specific cate
|
|
|
151130
151540
|
`;
|
|
151131
151541
|
function buildGpt55SisyphusJuniorPrompt(useTaskSystem, promptAppend) {
|
|
151132
151542
|
const personality = "";
|
|
151133
|
-
const taskSystemGuide =
|
|
151543
|
+
const taskSystemGuide = buildTaskSystemGuide4(useTaskSystem);
|
|
151134
151544
|
const base = SISYPHUS_JUNIOR_GPT_5_5_TEMPLATE.replace("{{ personality }}", personality).replace("{{ taskSystemGuide }}", taskSystemGuide);
|
|
151135
151545
|
if (!promptAppend)
|
|
151136
151546
|
return base;
|
|
@@ -151518,7 +151928,7 @@ function getSisyphusJuniorPromptSource(model) {
|
|
|
151518
151928
|
if (model && isKimiK2Model(model))
|
|
151519
151929
|
return "kimi-k2";
|
|
151520
151930
|
if (model && isGptModel(model)) {
|
|
151521
|
-
if (isGpt5_5Model(model))
|
|
151931
|
+
if (isGpt5_5Model(model) || isGpt5_6Model(model))
|
|
151522
151932
|
return "gpt-5-5";
|
|
151523
151933
|
const lower = model.toLowerCase();
|
|
151524
151934
|
if (lower.includes("gpt-5.4") || lower.includes("gpt-5-4"))
|