feat: add OMP (Oh My Pi) provider driver + Z.AI GLM docs #8583
ClosedFelipeMayerDev(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/8583/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/server/src/provider/acp/OmpAcpCliProbe.test.ts lines 12 to 12Resolvedby FelipeMayerDev(GitHub profile, opens in a new tab)@@ -0,0 +1,12 @@1+/**2+ * Optional integration check against a real `omp acp` install.3+ * Enable with: T3_OMP_ACP_PROBE=1 bun run test --filter OmpAcpCliProbe4+ */5+import * as NodeServices from "@effect/platform-node/NodeServices";6+import { it } from "@effect/vitest";7+import * as Effect from "effect/Effect";8+import { describe, expect } from "vite-plus/test";9+10+import * as AcpSessionRuntime from "./AcpSessionRuntime.ts";11+12+describe.runIf(process.env.T3_OMP_ACP_PROBE === "1")("OMP ACP CLI probe", () => {
- apps/server/src/provider/Layers/OmpAdapter.ts lines 188 to 193Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +173,21 @@173+ return ctx ? resolveCallbackTurnId(ctx) : undefined;174+};175+176+function parseOmpResume(raw: unknown): { sessionId: string } | undefined {177+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return undefined;178+ const record = raw as Record<string, unknown>;179+ if (record.schemaVersion !== OMP_RESUME_VERSION) return undefined;180+ if (typeof record.sessionId !== "string" || !record.sessionId.trim()) return undefined;181+ return { sessionId: record.sessionId.trim() };182+}183+184+export function selectOmpPermissionOptionId(185+ request: EffectAcpSchema.RequestPermissionRequest,186+ decision: Exclude<ProviderApprovalDecision, "cancel">,187+): string | undefined {188+ const preferredKind =189+ decision === "acceptForSession"190+ ? "allow_always"191+ : decision === "accept"192+ ? "allow_once"193+ : "reject_once";apps/server/src/provider/Layers/OmpAdapter.ts lines 194 to 201OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -0,0 +181,21 @@181+ return { sessionId: record.sessionId.trim() };182+}183+184+export function selectOmpPermissionOptionId(185+ request: EffectAcpSchema.RequestPermissionRequest,186+ decision: Exclude<ProviderApprovalDecision, "cancel">,187+): string | undefined {188+ const preferredKind =189+ decision === "acceptForSession"190+ ? "allow_always"191+ : decision === "accept"192+ ? "allow_once"193+ : "reject_once";194+ const preferred = request.options.find((entry) => entry.kind === preferredKind);195+ const preferredId = preferred?.optionId.trim();196+ if (preferredId) {197+ return preferredId;198+ }199+ // Agents sometimes omit allow_always. T3 still offers "Always allow this session".200+ if (decision === "acceptForSession") {201+ const once = request.options.find((entry) => entry.kind === "allow_once");docs/user/providers-claude.md lines 239 to 240OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -196,0 +220,21 @@220+221+Mark `ANTHROPIC_AUTH_TOKEN` as sensitive. T3 Code stores the value as a server secret and does not222+send it back to the app after saving.223+224+If you want this setup isolated from your normal Claude account, create that home first:225+226+```bash227+mkdir -p ~/.claude_zai_home228+```229+230+If you previously used the same Claude home with a normal Anthropic login, run `/logout` in a231+Claude Code session for that home before using Z.AI. Otherwise Claude Code may keep using cached232+Anthropic credentials instead of the Z.AI token.233+234+### Pick GLM Models235+236+Claude Code's default model roles can be mapped to GLM model IDs:237+238+```text239+ANTHROPIC_DEFAULT_OPUS_MODEL glm-4.7240+ANTHROPIC_DEFAULT_SONNET_MODEL glm-4.7
- @@ -132,3 +132,4 @@132132 const CURSOR_DRIVER_KIND = ProviderDriverKind.make("cursor");133133 const GROK_DRIVER_KIND = ProviderDriverKind.make("grok");134134 const OPENCODE_DRIVER_KIND = ProviderDriverKind.make("opencode");135+const OMP_DRIVER_KIND = ProviderDriverKind.make("omp");
- apps/web/src/components/Icons.tsx lines 218 to 230Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -216,0 +219,21 @@219+ {...props}220+ viewBox="0 0 24 24"221+ fill="none"222+ className={cn("text-[#0F0F0F] dark:text-[#F5F5F5]", className)}223+ >224+ <rect225+ x="2.75"226+ y="2.75"227+ width="18.5"228+ height="18.5"229+ rx="4.5"230+ stroke="currentColor"231+ strokeWidth="1.5"232+ />233+ <path234+ d="M6.5 8.25h11M9.25 8.25V13.5a2.75 2.75 0 0 1-2.75 2.75M14.75 8.25v8"235+ stroke="currentColor"236+ strokeWidth="1.5"237+ strokeLinecap="round"238+ />239+ </svg>
- docs/internals/overview.md lines 27 to 27OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -18,10 +18,10 @@1818 ┌──────────────────▼─────────────────────────────┐1919 │ apps/server │2020 │ orchestration engine (event-sourced) │21-│ provider driver registry (5 built-in drivers) │21+│ provider driver registry (6 built-in drivers) │2222 │ checkpointing, VCS, terminals, filesystem │2323 └──────────────────┬─────────────────────────────┘2424 │ per-driver transport2525 ┌──────────────────▼─────────────────────────────┐2626 │ Agent CLIs: Codex, Claude, Cursor, Grok, │27-│ OpenCode │27+│ OpenCode, OMP |
- packages/contracts/src/model.ts line 167OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -162,3 +164,4 @@162164 [CODEX_DRIVER_KIND]: DEFAULT_TEXT_GENERATION_MODEL,163165 [CLAUDE_DRIVER_KIND]: "claude-haiku-4-5",164166 [CURSOR_DRIVER_KIND]: "composer-2",167+ [OMP_DRIVER_KIND]: "anthropic/claude-haiku-4-5",
- apps/server/src/provider/Layers/OmpAdapter.ts lines 1636 to 1640Resolvedby FelipeMayerDev(GitHub profile, opens in a new tab)@@ -0,0 +1620,21 @@1620+ activeTurnId !== undefined &&1621+ activeTurnId !== observed.interruptedTurnId1622+ ) {1623+ return;1624+ }1625+ const interruptedTurnId =1626+ observed.interruptedTurnId ?? turnId ?? activeTurnId ?? ctx.session.activeTurnId;1627+ yield* settlePendingApprovalsAsCancelled(ctx.pendingApprovals);1628+ yield* Effect.ignore(1629+ ctx.acp.cancel.pipe(1630+ Effect.mapError((error) =>1631+ mapAcpToAdapterError(PROVIDER, threadId, "session/cancel", error),1632+ ),1633+ ),1634+ );1635+ if (interruptedTurnId) {1636+ ctx.interruptedTurnIds.add(interruptedTurnId);1637+ yield* settlePromptInFlight(threadId, interruptedTurnId, ctx.acpSessionId, {1638+ completedStopReason: "cancelled",1639+ settleAllPrompts: true,1640+ });
- apps/server/src/provider/Layers/OmpAdapter.ts line 1646OutdatedResolvedby FelipeMayerDev(GitHub profile, opens in a new tab)@@ -0,0 +1626,21 @@1626+ observed.interruptedTurnId ?? turnId ?? activeTurnId ?? ctx.session.activeTurnId;1627+ yield* settlePendingApprovalsAsCancelled(ctx.pendingApprovals);1628+ yield* Effect.ignore(1629+ ctx.acp.cancel.pipe(1630+ Effect.mapError((error) =>1631+ mapAcpToAdapterError(PROVIDER, threadId, "session/cancel", error),1632+ ),1633+ ),1634+ );1635+ if (interruptedTurnId) {1636+ ctx.interruptedTurnIds.add(interruptedTurnId);1637+ yield* settlePromptInFlight(threadId, interruptedTurnId, ctx.acpSessionId, {1638+ completedStopReason: "cancelled",1639+ settleAllPrompts: true,1640+ });1641+ // The marker only has to outlive the in-flight prompt's race with1642+ // this cancel. settleAllPrompts has now zeroed promptsInFlight and1643+ // cleared activeTurnId, so the sendTurn fiber and the liveness1644+ // path both bail on those instead, and keeping the id would grow1645+ // the set by one UUID per cancellation for the session's life.1646+ ctx.interruptedTurnIds.delete(interruptedTurnId);
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
f80aed67-33c1-4754-a4b3-5b81ae4613a2You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.