opencode: remove oh-my-openagent from all profiles
Drops the plugin entry and the agent/* model aliases, sets plain default models, and removes the OMO roster swap from opencode.zsh.
This commit is contained in:
1 parent
3fb10dd4c3
commit
6b9b1697f2
5 files changed
+10
-536
No files matched your search
+1
-54
@@ -70,55 +70,6 @@ _oc_launch() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# ---- install the profile's OMO roster --------------------------------
|
||||
# WHY THIS EXISTS. OMO reads exactly ONE config, resolveHomeDir($HOME) +
|
||||
# "/.omo/omo.jsonc". There is no path override: `profiles`/OMO_PROFILE are in
|
||||
# the new schema but the OLD loader rejects them, and a config the loaders
|
||||
# reject fails SILENTLY (agent model bindings just stop applying). Setting
|
||||
# HOME per profile would relocate opencode's own data and cache dirs too.
|
||||
#
|
||||
# It matters because OMO picks its per-model prompt by string-matching the
|
||||
# LAST PATH SEGMENT of the model name, so the alias has to name the model
|
||||
# family (see guides/llm/robots.md 5.1). Personal runs Kimi on the thinking
|
||||
# and worker roles; work may not (PRC exclusion). One shared alias name
|
||||
# therefore cannot be correct for both -- work was left running Kimi prompts
|
||||
# on GPT models, 6 of 11 agents mismatched.
|
||||
#
|
||||
# The opencode-side fix does NOT work and was tested before this was written:
|
||||
# OMO builds protectedBuiltinAgentNames from its own agent keys and runs
|
||||
# filterProtectedAgentOverrides over opencode's `agent` config, so an
|
||||
# `agent.sisyphus.model` in a profile config is silently DROPPED.
|
||||
#
|
||||
# So the roster is swapped here instead. Only omo.jsonc is touched;
|
||||
# codegraph/, lsp-daemon/ and runtime/ under ~/.omo stay shared.
|
||||
#
|
||||
# RACE: two sessions in different profiles started within the same instant
|
||||
# could read the other's roster. The window is startup-only (OMO reads the
|
||||
# file once), and the failure is BOUNDED AND LOUD -- the LiteLLM virtual key,
|
||||
# not this file, is the policy boundary, so a work session that ends up with
|
||||
# the personal roster gets a 403 on the Kimi models rather than using them.
|
||||
local roster
|
||||
case "$profile" in
|
||||
personal) roster=personal ;;
|
||||
work|work-strict) roster=work ;;
|
||||
local) roster= ;; # local.json loads no OMO plugin
|
||||
esac
|
||||
if [[ -n "$roster" ]]; then
|
||||
local src="$HOME/.omo/profiles/${roster}.jsonc"
|
||||
if [[ ! -r "$src" ]]; then
|
||||
print -u2 "oc: OMO roster '$src' is missing."
|
||||
print -u2 " Refusing to launch -- the wrong roster silently mis-prompts every agent."
|
||||
return 1
|
||||
fi
|
||||
# Atomic: never leave a half-written omo.jsonc if this is interrupted.
|
||||
if ! { cp -- "$src" "$HOME/.omo/.omo.jsonc.$$" &&
|
||||
mv -f -- "$HOME/.omo/.omo.jsonc.$$" "$HOME/.omo/omo.jsonc" }; then
|
||||
rm -f -- "$HOME/.omo/.omo.jsonc.$$"
|
||||
print -u2 "oc: could not install the $roster OMO roster."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Make the active mode obvious: banner, terminal title, and a prompt marker
|
||||
# that survives for the rest of the shell if the profile is exported.
|
||||
local colour
|
||||
@@ -166,11 +117,7 @@ _oc_launch() {
|
||||
# have received." This is a preference, not a fix -- REMOVE THESE TWO KEYS to
|
||||
# get Plan Mode back.
|
||||
#
|
||||
# Note this is NOT an OMO feature, though it looks like one. OMO's agents
|
||||
# carry only description/model/tools and cannot trigger on prompt text; the
|
||||
# `plan` agent is native to opencode. Disabling OMO would not have stopped it,
|
||||
# and would have broken the default model -- `agent/atlas-glm-5.3` is rewritten
|
||||
# by the OMO plugin at request time and 400s at LiteLLM without it.
|
||||
# The `plan` agent is native to opencode, not part of a plugin.
|
||||
#
|
||||
# Personal is still wrapped under the bare name so `opencode` does the
|
||||
# expected thing and gets a key.
|
||||
|
||||
Reference in new issue
Block a user