oh-my-copilot 4.13.21 → 4.13.54

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.
Files changed (219) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +8 -0
  4. package/agents/code-reviewer.agent.md +24 -6
  5. package/agents/designer.agent.md +12 -0
  6. package/bridge/cli.cjs +2231 -1222
  7. package/bridge/mcp-server.cjs +678 -261
  8. package/bridge/runtime-cli.cjs +55 -8
  9. package/bridge/team.js +507 -38
  10. package/dist/__tests__/agent-registry.test.js +92 -1
  11. package/dist/__tests__/agent-registry.test.js.map +1 -1
  12. package/dist/__tests__/auto-slash-aliases.test.js +6 -6
  13. package/dist/__tests__/auto-slash-aliases.test.js.map +1 -1
  14. package/dist/__tests__/auto-update.test.js +132 -2
  15. package/dist/__tests__/auto-update.test.js.map +1 -1
  16. package/dist/__tests__/bedrock-model-routing.test.js +18 -17
  17. package/dist/__tests__/bedrock-model-routing.test.js.map +1 -1
  18. package/dist/__tests__/delegation-enforcer.test.js +46 -6
  19. package/dist/__tests__/delegation-enforcer.test.js.map +1 -1
  20. package/dist/__tests__/hooks/session-end-cleanup.test.d.ts +2 -0
  21. package/dist/__tests__/hooks/session-end-cleanup.test.d.ts.map +1 -0
  22. package/dist/__tests__/hooks/session-end-cleanup.test.js +93 -0
  23. package/dist/__tests__/hooks/session-end-cleanup.test.js.map +1 -0
  24. package/dist/__tests__/hud/stdin.test.d.ts +2 -0
  25. package/dist/__tests__/hud/stdin.test.d.ts.map +1 -0
  26. package/dist/__tests__/hud/stdin.test.js +556 -0
  27. package/dist/__tests__/hud/stdin.test.js.map +1 -0
  28. package/dist/__tests__/model-routing-override-three-site-sync.test.d.ts +2 -0
  29. package/dist/__tests__/model-routing-override-three-site-sync.test.d.ts.map +1 -0
  30. package/dist/__tests__/model-routing-override-three-site-sync.test.js +75 -0
  31. package/dist/__tests__/model-routing-override-three-site-sync.test.js.map +1 -0
  32. package/dist/__tests__/non-claude-provider-detection.test.js +37 -0
  33. package/dist/__tests__/non-claude-provider-detection.test.js.map +1 -1
  34. package/dist/__tests__/package-dir-resolution-regression.test.js +25 -0
  35. package/dist/__tests__/package-dir-resolution-regression.test.js.map +1 -1
  36. package/dist/__tests__/pre-tool-enforcer.test.js +304 -0
  37. package/dist/__tests__/pre-tool-enforcer.test.js.map +1 -1
  38. package/dist/__tests__/session-start-script-context.test.js +121 -0
  39. package/dist/__tests__/session-start-script-context.test.js.map +1 -1
  40. package/dist/__tests__/setup-claude-md-script.test.js +44 -1
  41. package/dist/__tests__/setup-claude-md-script.test.js.map +1 -1
  42. package/dist/__tests__/skills.test.js +77 -7
  43. package/dist/__tests__/skills.test.js.map +1 -1
  44. package/dist/__tests__/wiki-hook-output-format.test.d.ts +2 -0
  45. package/dist/__tests__/wiki-hook-output-format.test.d.ts.map +1 -0
  46. package/dist/__tests__/wiki-hook-output-format.test.js +59 -0
  47. package/dist/__tests__/wiki-hook-output-format.test.js.map +1 -0
  48. package/dist/agents/definitions.d.ts.map +1 -1
  49. package/dist/agents/definitions.js +2 -1
  50. package/dist/agents/definitions.js.map +1 -1
  51. package/dist/autoresearch/__tests__/decide-outcome.test.d.ts +2 -0
  52. package/dist/autoresearch/__tests__/decide-outcome.test.d.ts.map +1 -0
  53. package/dist/autoresearch/__tests__/decide-outcome.test.js +69 -0
  54. package/dist/autoresearch/__tests__/decide-outcome.test.js.map +1 -0
  55. package/dist/autoresearch/runtime.d.ts.map +1 -1
  56. package/dist/autoresearch/runtime.js +16 -2
  57. package/dist/autoresearch/runtime.js.map +1 -1
  58. package/dist/cli/__tests__/launch.test.js +23 -0
  59. package/dist/cli/__tests__/launch.test.js.map +1 -1
  60. package/dist/cli/__tests__/self-improve-paths.test.js +3 -2
  61. package/dist/cli/__tests__/self-improve-paths.test.js.map +1 -1
  62. package/dist/cli/__tests__/team.test.js +100 -0
  63. package/dist/cli/__tests__/team.test.js.map +1 -1
  64. package/dist/cli/commands/__tests__/team-role-shorthand.test.js +30 -0
  65. package/dist/cli/commands/__tests__/team-role-shorthand.test.js.map +1 -1
  66. package/dist/cli/commands/__tests__/team.test.js +48 -1
  67. package/dist/cli/commands/__tests__/team.test.js.map +1 -1
  68. package/dist/cli/commands/team.d.ts +2 -0
  69. package/dist/cli/commands/team.d.ts.map +1 -1
  70. package/dist/cli/commands/team.js +9 -2
  71. package/dist/cli/commands/team.js.map +1 -1
  72. package/dist/cli/launch.d.ts.map +1 -1
  73. package/dist/cli/launch.js +7 -0
  74. package/dist/cli/launch.js.map +1 -1
  75. package/dist/cli/team.d.ts.map +1 -1
  76. package/dist/cli/team.js +34 -3
  77. package/dist/cli/team.js.map +1 -1
  78. package/dist/config/__tests__/loader.test.js +35 -4
  79. package/dist/config/__tests__/loader.test.js.map +1 -1
  80. package/dist/config/__tests__/models.test.js +126 -3
  81. package/dist/config/__tests__/models.test.js.map +1 -1
  82. package/dist/config/models.d.ts +8 -0
  83. package/dist/config/models.d.ts.map +1 -1
  84. package/dist/config/models.js +119 -8
  85. package/dist/config/models.js.map +1 -1
  86. package/dist/features/auto-update.d.ts.map +1 -1
  87. package/dist/features/auto-update.js +53 -5
  88. package/dist/features/auto-update.js.map +1 -1
  89. package/dist/features/delegation-enforcer.d.ts.map +1 -1
  90. package/dist/features/delegation-enforcer.js +10 -9
  91. package/dist/features/delegation-enforcer.js.map +1 -1
  92. package/dist/hooks/__tests__/bridge-routing.test.js +1 -0
  93. package/dist/hooks/__tests__/bridge-routing.test.js.map +1 -1
  94. package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
  95. package/dist/hooks/autopilot/enforcement.js +19 -0
  96. package/dist/hooks/autopilot/enforcement.js.map +1 -1
  97. package/dist/hooks/bridge.d.ts.map +1 -1
  98. package/dist/hooks/bridge.js +135 -4
  99. package/dist/hooks/bridge.js.map +1 -1
  100. package/dist/hooks/persistent-mode/index.d.ts +6 -0
  101. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  102. package/dist/hooks/persistent-mode/index.js +96 -0
  103. package/dist/hooks/persistent-mode/index.js.map +1 -1
  104. package/dist/hooks/persistent-mode/stop-hook-blocking.test.js +152 -23
  105. package/dist/hooks/persistent-mode/stop-hook-blocking.test.js.map +1 -1
  106. package/dist/hooks/session-end/index.d.ts +9 -2
  107. package/dist/hooks/session-end/index.d.ts.map +1 -1
  108. package/dist/hooks/session-end/index.js +90 -35
  109. package/dist/hooks/session-end/index.js.map +1 -1
  110. package/dist/hud/stdin.d.ts +12 -1
  111. package/dist/hud/stdin.d.ts.map +1 -1
  112. package/dist/hud/stdin.js +123 -18
  113. package/dist/hud/stdin.js.map +1 -1
  114. package/dist/hud/types.d.ts +1 -0
  115. package/dist/hud/types.d.ts.map +1 -1
  116. package/dist/hud/types.js.map +1 -1
  117. package/dist/installer/__tests__/session-start-template.test.d.ts +2 -0
  118. package/dist/installer/__tests__/session-start-template.test.d.ts.map +1 -0
  119. package/dist/installer/__tests__/session-start-template.test.js +174 -0
  120. package/dist/installer/__tests__/session-start-template.test.js.map +1 -0
  121. package/dist/lib/__tests__/mode-state-io.test.js +75 -12
  122. package/dist/lib/__tests__/mode-state-io.test.js.map +1 -1
  123. package/dist/lib/mode-state-io.d.ts +11 -0
  124. package/dist/lib/mode-state-io.d.ts.map +1 -1
  125. package/dist/lib/mode-state-io.js +64 -0
  126. package/dist/lib/mode-state-io.js.map +1 -1
  127. package/dist/lib/worktree-paths.d.ts +12 -0
  128. package/dist/lib/worktree-paths.d.ts.map +1 -1
  129. package/dist/lib/worktree-paths.js +75 -0
  130. package/dist/lib/worktree-paths.js.map +1 -1
  131. package/dist/planning/__tests__/artifacts.test.d.ts +2 -0
  132. package/dist/planning/__tests__/artifacts.test.d.ts.map +1 -0
  133. package/dist/planning/__tests__/artifacts.test.js +486 -0
  134. package/dist/planning/__tests__/artifacts.test.js.map +1 -0
  135. package/dist/planning/artifact-names.d.ts +13 -0
  136. package/dist/planning/artifact-names.d.ts.map +1 -0
  137. package/dist/planning/artifact-names.js +108 -0
  138. package/dist/planning/artifact-names.js.map +1 -0
  139. package/dist/planning/artifacts.d.ts +47 -0
  140. package/dist/planning/artifacts.d.ts.map +1 -0
  141. package/dist/planning/artifacts.js +221 -0
  142. package/dist/planning/artifacts.js.map +1 -0
  143. package/dist/team/__tests__/api-interop.compatibility.test.js +194 -5
  144. package/dist/team/__tests__/api-interop.compatibility.test.js.map +1 -1
  145. package/dist/team/__tests__/model-contract.test.js +92 -2
  146. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  147. package/dist/team/__tests__/runtime-v2.dispatch.test.js +30 -0
  148. package/dist/team/__tests__/runtime-v2.dispatch.test.js.map +1 -1
  149. package/dist/team/__tests__/scaling.test.js +39 -1
  150. package/dist/team/__tests__/scaling.test.js.map +1 -1
  151. package/dist/team/__tests__/worker-bootstrap.test.js +6 -0
  152. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  153. package/dist/team/api-interop.d.ts.map +1 -1
  154. package/dist/team/api-interop.js +89 -2
  155. package/dist/team/api-interop.js.map +1 -1
  156. package/dist/team/delegation-evidence.d.ts +5 -0
  157. package/dist/team/delegation-evidence.d.ts.map +1 -0
  158. package/dist/team/delegation-evidence.js +29 -0
  159. package/dist/team/delegation-evidence.js.map +1 -0
  160. package/dist/team/model-contract.d.ts +8 -0
  161. package/dist/team/model-contract.d.ts.map +1 -1
  162. package/dist/team/model-contract.js +13 -0
  163. package/dist/team/model-contract.js.map +1 -1
  164. package/dist/team/runtime-v2.d.ts +2 -1
  165. package/dist/team/runtime-v2.d.ts.map +1 -1
  166. package/dist/team/runtime-v2.js +3 -1
  167. package/dist/team/runtime-v2.js.map +1 -1
  168. package/dist/team/state/tasks.d.ts +4 -1
  169. package/dist/team/state/tasks.d.ts.map +1 -1
  170. package/dist/team/state/tasks.js +38 -1
  171. package/dist/team/state/tasks.js.map +1 -1
  172. package/dist/team/team-ops.d.ts +4 -1
  173. package/dist/team/team-ops.d.ts.map +1 -1
  174. package/dist/team/team-ops.js +2 -2
  175. package/dist/team/team-ops.js.map +1 -1
  176. package/dist/team/types.d.ts +22 -1
  177. package/dist/team/types.d.ts.map +1 -1
  178. package/dist/team/types.js.map +1 -1
  179. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  180. package/dist/team/worker-bootstrap.js +6 -1
  181. package/dist/team/worker-bootstrap.js.map +1 -1
  182. package/dist/tools/__tests__/state-tools.test.js +322 -5
  183. package/dist/tools/__tests__/state-tools.test.js.map +1 -1
  184. package/dist/tools/__tests__/wiki-tools-working-directory.test.d.ts +2 -0
  185. package/dist/tools/__tests__/wiki-tools-working-directory.test.d.ts.map +1 -0
  186. package/dist/tools/__tests__/wiki-tools-working-directory.test.js +66 -0
  187. package/dist/tools/__tests__/wiki-tools-working-directory.test.js.map +1 -0
  188. package/dist/tools/state-tools.d.ts +3 -10
  189. package/dist/tools/state-tools.d.ts.map +1 -1
  190. package/dist/tools/state-tools.js +393 -91
  191. package/dist/tools/state-tools.js.map +1 -1
  192. package/dist/tools/wiki-tools.js +8 -8
  193. package/dist/tools/wiki-tools.js.map +1 -1
  194. package/docs/GETTING-STARTED.md +7 -0
  195. package/docs/REFERENCE.md +5 -5
  196. package/docs/copilot-instructions.md +1 -1
  197. package/package.json +1 -1
  198. package/scripts/lib/model-routing-override-message.mjs +21 -0
  199. package/scripts/persistent-mode.cjs +107 -0
  200. package/scripts/persistent-mode.mjs +102 -0
  201. package/scripts/post-tool-verifier.mjs +1 -0
  202. package/scripts/pre-tool-enforcer.mjs +163 -2
  203. package/scripts/session-start.mjs +63 -0
  204. package/scripts/setup-copilot-instructions.sh +12 -2
  205. package/scripts/wiki-pre-compact.mjs +1 -4
  206. package/skills/configure-notifications/SKILL.md +3 -3
  207. package/skills/deep-dive/SKILL.md +52 -4
  208. package/skills/deep-interview/SKILL.md +109 -15
  209. package/skills/mcp-setup/SKILL.md +60 -45
  210. package/skills/omc-setup/SKILL.md +3 -3
  211. package/skills/omc-setup/phases/01-install-claude-md.md +1 -1
  212. package/skills/omc-setup/phases/04-welcome.md +8 -8
  213. package/skills/plan/SKILL.md +1 -1
  214. package/skills/project-session-manager/SKILL.md +2 -2
  215. package/skills/project-session-manager/psm.sh +1 -1
  216. package/skills/ralplan/SKILL.md +2 -2
  217. package/templates/hooks/lib/model-routing-override-message.mjs +21 -0
  218. package/templates/hooks/persistent-mode.mjs +66 -0
  219. package/templates/hooks/session-start.mjs +62 -0
@@ -0,0 +1,21 @@
1
+ // Shared constant imported by scripts/session-start.mjs and
2
+ // templates/hooks/session-start.mjs. Kept in a side-effect-free module so
3
+ // tests can import it without triggering hook entrypoint side effects.
4
+ export const MODEL_ROUTING_OVERRIDE_MESSAGE = `<system-reminder>
5
+
6
+ [MODEL ROUTING OVERRIDE — NON-STANDARD PROVIDER DETECTED]
7
+
8
+ This environment uses a non-standard model provider (AWS Bedrock, Google Vertex AI, or a proxy such as CC Switch / LiteLLM).
9
+
10
+ How to pass \`model\` on Task/Agent calls:
11
+ - Prefer a tier alias: \`model: "sonnet"\`, \`model: "opus"\`, or \`model: "haiku"\`. OMC's pre-tool enforcer resolves these to provider-safe IDs when one of these env vars is set: \`ANTHROPIC_DEFAULT_SONNET_MODEL\` (and sibling \`ANTHROPIC_DEFAULT_OPUS_MODEL\` / \`ANTHROPIC_DEFAULT_HAIKU_MODEL\`), \`CLAUDE_CODE_BEDROCK_SONNET_MODEL\` (and sibling \`CLAUDE_CODE_BEDROCK_OPUS_MODEL\` / \`CLAUDE_CODE_BEDROCK_HAIKU_MODEL\`), or \`OMC_SUBAGENT_MODEL\`.
12
+ - If none of those env vars are configured, the enforcer will deny the tier alias with an env-var configuration hint — set one of them in your \`settings.json\` env or shell profile.
13
+ - The enforcer denies tier aliases it cannot resolve. It also denies provider-specific IDs that carry a \`[1m]\` context-window suffix or otherwise fail subagent-safe validation (sub-agents cannot inherit \`[1m]\`). Valid provider-specific IDs without extended-context suffixes are allowed.
14
+
15
+ When the session model carries a \`[1m]\` suffix, passing an explicit \`model\` is REQUIRED — omitting it will be denied (sub-agents cannot inherit the \`[1m]\` suffix). Use a tier alias (requires resolver env vars above); the Agent tool schema does not accept provider-specific IDs, so tier aliases are the only valid option.
16
+
17
+ When the session model has no \`[1m]\` suffix, omitting \`model\` is safe UNLESS a custom sub-agent definition pins a bare Anthropic model ID (e.g. \`model: claude-sonnet-4-6\` in agent frontmatter). When resolver env vars are configured, the enforcer will deny that call with tier-alias guidance; when they are absent, the call is not denied by the enforcer but will fail at the provider. Either way, custom sub-agents should pin tier aliases (not bare Anthropic IDs) in their frontmatter. Shipped OMC agents already do this and are unaffected.
18
+
19
+ The CLAUDE.md instruction "Pass model on Task calls: haiku, sonnet, opus" applies here — subject to the resolution prerequisites above.
20
+
21
+ </system-reminder>`;
@@ -137,6 +137,7 @@ Do NOT skip this step. Do NOT move on without fixing the error.
137
137
  * from causing the stop hook to malfunction in new sessions.
138
138
  */
139
139
  const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
140
+ const PENDING_ASYNC_STATE_STALE_MS = 24 * 60 * 60 * 1000;
140
141
  const TEAM_TERMINAL_PHASES = new Set([
141
142
  "completed",
142
143
  "complete",
@@ -183,6 +184,66 @@ function isStaleState(state) {
183
184
  return age > STALE_STATE_THRESHOLD_MS;
184
185
  }
185
186
 
187
+
188
+ function parseTimestamp(value) {
189
+ if (typeof value !== "string" || value.length === 0) return null;
190
+ const parsed = new Date(value).getTime();
191
+ return Number.isFinite(parsed) ? parsed : null;
192
+ }
193
+
194
+ function isFreshTimestamp(value, ttlMs = PENDING_ASYNC_STATE_STALE_MS) {
195
+ const parsed = parseTimestamp(value);
196
+ return parsed !== null && Date.now() - parsed <= ttlMs;
197
+ }
198
+
199
+ function hasPendingBackgroundTask(stateDir, sessionId) {
200
+ const safeSessionId = sanitizeSessionId(sessionId);
201
+ const hudPath = safeSessionId
202
+ ? join(stateDir, "sessions", safeSessionId, "hud-state.json")
203
+ : join(stateDir, "hud-state.json");
204
+ const hudState = readJsonFile(hudPath);
205
+ return Boolean(hudState?.backgroundTasks?.some((task) => {
206
+ if (task?.status !== "running") return false;
207
+ return isFreshTimestamp(task.startedAt ?? task.startTime);
208
+ }));
209
+ }
210
+
211
+ function readPendingWakeupStates(stateDir, sessionId) {
212
+ const safeSessionId = sanitizeSessionId(sessionId);
213
+ const dirs = safeSessionId ? [join(stateDir, "sessions", safeSessionId), stateDir] : [stateDir];
214
+ const fileNames = ["scheduled-wakeup-state.json", "schedule-wakeup-state.json", "wakeup-state.json"];
215
+ const states = [];
216
+ for (const dir of dirs) {
217
+ for (const fileName of fileNames) {
218
+ const state = readJsonFile(join(dir, fileName));
219
+ if (state && typeof state === "object") states.push(state);
220
+ }
221
+ }
222
+ return states;
223
+ }
224
+
225
+ function hasPendingScheduledWakeup(stateDir, sessionId) {
226
+ const now = Date.now();
227
+ return readPendingWakeupStates(stateDir, sessionId).some((state) => {
228
+ const status = typeof state.status === "string" ? state.status.toLowerCase() : "";
229
+ if (["completed", "complete", "cancelled", "canceled", "failed", "expired"].includes(status)) {
230
+ return false;
231
+ }
232
+ const dueAt = parseTimestamp(
233
+ state.due_at ?? state.wakeup_at ?? state.scheduled_for ?? state.deadline_at ?? state.expires_at,
234
+ );
235
+ if (dueAt !== null) return dueAt > now;
236
+ if (state.active === true || state.pending === true) {
237
+ return isFreshTimestamp(state.created_at ?? state.updated_at ?? state.started_at);
238
+ }
239
+ return false;
240
+ });
241
+ }
242
+
243
+ function hasPendingOwnedAsyncWork(stateDir, sessionId) {
244
+ return hasPendingBackgroundTask(stateDir, sessionId) || hasPendingScheduledWakeup(stateDir, sessionId);
245
+ }
246
+
186
247
  function normalizeTeamPhase(state) {
187
248
  if (!state || typeof state !== "object") return null;
188
249
 
@@ -704,6 +765,11 @@ async function main() {
704
765
  return;
705
766
  }
706
767
 
768
+ if (hasPendingOwnedAsyncWork(stateDir, sessionId)) {
769
+ console.log(JSON.stringify({ continue: true, suppressOutput: true }));
770
+ return;
771
+ }
772
+
707
773
  // Read all mode states (session-scoped when sessionId provided)
708
774
  const ralph = readStateFileWithSession(
709
775
  stateDir,
@@ -142,6 +142,68 @@ const OMC_STARTUP_GUIDANCE_MAX_CHARS = 8000;
142
142
  const SESSION_START_CONTEXT_BUDGET = 6000;
143
143
  const SESSION_START_OMISSION_NOTICE = '[Additional SessionStart context omitted to preserve the 6000-character aggregate budget.]';
144
144
 
145
+ const { MODEL_ROUTING_OVERRIDE_MESSAGE } = await import(pathToFileURL(join(__dirname, 'lib', 'model-routing-override-message.mjs')).href);
146
+
147
+ function isTruthyProviderFlag(value) {
148
+ return value === '1' || value === 'true';
149
+ }
150
+
151
+ function getSessionModelId() {
152
+ return process.env.CLAUDE_MODEL || process.env.ANTHROPIC_MODEL || '';
153
+ }
154
+
155
+ function isBedrockSession() {
156
+ if (isTruthyProviderFlag(process.env.CLAUDE_CODE_USE_BEDROCK)) return true;
157
+ const modelId = getSessionModelId();
158
+ return Boolean(
159
+ modelId && (
160
+ /^((us|eu|ap|global)\.anthropic\.|anthropic\.claude)/i.test(modelId) ||
161
+ (
162
+ /^arn:aws(-[^:]+)?:bedrock:/i.test(modelId) &&
163
+ /:(inference-profile|application-inference-profile)\//i.test(modelId) &&
164
+ modelId.toLowerCase().includes('claude')
165
+ )
166
+ )
167
+ );
168
+ }
169
+
170
+ function isVertexSession() {
171
+ if (isTruthyProviderFlag(process.env.CLAUDE_CODE_USE_VERTEX)) return true;
172
+ const modelId = getSessionModelId();
173
+ return Boolean(modelId && modelId.toLowerCase().startsWith('vertex_ai/'));
174
+ }
175
+
176
+ function readRoutingForceInheritFromConfig(directory) {
177
+ const configPaths = [
178
+ join(configDir, '.omc-config.json'),
179
+ join(directory, '.omc', 'config.json'),
180
+ ];
181
+
182
+ for (const configPath of configPaths) {
183
+ const config = readJsonFile(configPath);
184
+ if (config?.routing?.forceInherit === true) return true;
185
+ }
186
+
187
+ return false;
188
+ }
189
+
190
+ function shouldEmitModelRoutingOverride(directory) {
191
+ if (process.env.OMC_ROUTING_FORCE_INHERIT === 'true') return true;
192
+ if (process.env.OMC_ROUTING_FORCE_INHERIT === 'false') return false;
193
+ if (readRoutingForceInheritFromConfig(directory)) return true;
194
+
195
+ if (isBedrockSession() || isVertexSession()) return true;
196
+
197
+ const modelId = getSessionModelId();
198
+ if (modelId && !modelId.toLowerCase().includes('claude')) return true;
199
+
200
+ const baseUrl = process.env.ANTHROPIC_BASE_URL || '';
201
+ if (baseUrl && !baseUrl.includes('anthropic.com')) return true;
202
+
203
+ return false;
204
+ }
205
+
206
+
145
207
  function compactBudgetedText(text, maxChars) {
146
208
  const notice = '\n...[truncated to preserve SessionStart context budget]';
147
209
  if (!text || text.length <= maxChars) return text || '';