Skip to content
Merged
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
37 changes: 37 additions & 0 deletions src/plugin-handlers/config-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,43 @@ describe("Prometheus direct override priority over category", () => {
expect(agents.prometheus).toBeDefined()
expect(agents.prometheus.temperature).toBe(0.1)
})

test("prometheus prompt_append is appended to base prompt", async () => {
// #given - prometheus override with prompt_append
const customInstructions = "## Custom Project Rules\nUse max 2 commits."
const pluginConfig: OhMyOpenCodeConfig = {
sisyphus_agent: {
planner_enabled: true,
},
agents: {
prometheus: {
prompt_append: customInstructions,
},
},
}
const config: Record<string, unknown> = {
model: "anthropic/claude-opus-4-5",
agent: {},
}
const handler = createConfigHandler({
ctx: { directory: "/tmp" },
pluginConfig,
modelCacheState: {
anthropicContext1MEnabled: false,
modelContextLimitsCache: new Map(),
},
})

// #when
await handler(config)

// #then - prompt_append is appended to base prompt, not overwriting it
const agents = config.agent as Record<string, { prompt?: string }>
expect(agents.prometheus).toBeDefined()
expect(agents.prometheus.prompt).toContain("Prometheus")
expect(agents.prometheus.prompt).toContain(customInstructions)
expect(agents.prometheus.prompt!.endsWith(customInstructions)).toBe(true)
})
})

describe("Deadlock prevention - fetchAvailableModels must not receive client", () => {
Expand Down
16 changes: 13 additions & 3 deletions src/plugin-handlers/config-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,19 @@ export function createConfigHandler(deps: ConfigHandlerDeps) {
: {}),
};

agentConfig["prometheus"] = prometheusOverride
? { ...prometheusBase, ...prometheusOverride }
: prometheusBase;
// Properly handle prompt_append for Prometheus
// Extract prompt_append and append it to prompt instead of shallow spread
// Fixes: https://github.com/code-yeongyu/oh-my-opencode/issues/723
if (prometheusOverride) {
const { prompt_append, ...restOverride } = prometheusOverride as Record<string, unknown> & { prompt_append?: string };
const merged = { ...prometheusBase, ...restOverride };
if (prompt_append && merged.prompt) {
merged.prompt = merged.prompt + "\n" + prompt_append;
}
agentConfig["prometheus"] = merged;
} else {
agentConfig["prometheus"] = prometheusBase;
}
}

const filteredConfigAgents = configAgent
Expand Down