GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(claude): report provider-observed models after fallback by deveshsangwan · Pull Request #27738 · pingdotgg/t3code

fix(claude): report provider-observed models after fallback #27738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
deveshsangwan wants to merge 5 commits into pingdotgg:main from deveshsangwan:fix/27705-claude-fallback-reporting

Uh oh!

There was an error while loading. Please reload this page.

Closed

fix(claude): report provider-observed models after fallback #27738

Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
392f67e
fix(claude): report provider-observed models after fallback
deveshsangwan Oct 30, 2026
19e4b06
Merge main into fix/27705-claude-fallback-reporting
deveshsangwan Oct 30, 2026
2c8dfed
fix(claude): scope model observations to the current attempt
deveshsangwan Oct 30, 2026
ff38fdb
fix(server): keep model provenance valid across MCP JSON delivery
deveshsangwan Oct 30, 2026
0a4c3a7
fix(claude): include provider notices in fallback completion
deveshsangwan Oct 30, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

167 changes: 96 additions & 71 deletions 167 apps/server/src/mcp/OrchestratorMcpService.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
type OrchestratorMcpCapabilitiesResult,
OrchestratorMcpTarget,
type OrchestrationV2ThreadShell,
type OrchestrationV2Run,
type OrchestrationV2Subagent,
type ScheduledTask,
ScheduledTaskId,
ProjectId,
Expand Down Expand Up @@ -2413,78 +2415,101 @@ describe("OrchestratorMcpService provider resolution", () => {
}),
);
});
it.effect(
"reports the child run's selection after a restart and the thread selection before launch",
() =>
Effect.gen(function* () {
const runSelection = {
instanceId: ProviderInstanceId.make("claudeAgent-personal"),
model: "claude-opus-4-6",
options: [
{ id: "effort", value: "max" },
{ id: "fastMode", value: true },
],
} as const;
const threadSelection = {
instanceId: codexInstanceId,
model: "gpt-5.4",
options: [{ id: "reasoningEffort", value: "high" }],
} as const;
let hasRun = true;
const task = {
id: taskId,
threadId: parentThreadId,
origin: "app_owned",
childThreadId,
providerInstanceId: ProviderInstanceId.make("claudeAgent-work"),
model: "claude-sonnet-4-6",
status: "running",
result: null,
};
const dependencies = Layer.mergeAll(
NodeServices.layer,
Layer.mock(ThreadManagementService.ThreadManagementService)({
getThreadRecords: (threadId) =>
Effect.succeed(
threadId === parentThreadId
? parentProjection([task])
: ({
...childProjection,
thread: { ...childProjection.thread, modelSelection: threadSelection },
runs: hasRun
? [
{
id: RunId.make("run:mcp-restarted-child"),
ordinal: 1,
status: "running",
modelSelection: runSelection,
},
]
: [],
} as unknown as OrchestrationV2ThreadProjection),
),
}),
ServerSettings.layerTest(),
providerRegistryLayer([]),
adapterRegistryLayer([]),
Layer.mock(ProjectService.ProjectService)({}),
Layer.mock(SecretRequests.SecretRequests)({}),
Layer.mock(RemoteDelegation.RemoteDelegation)({}),
Layer.mock(ScheduledTaskService.ScheduledTaskService)({}),
);
yield* Effect.gen(function* () {
const service = yield* OrchestratorMcpService.OrchestratorMcpService;
for (const selection of [runSelection, threadSelection]) {
const result = yield* service.taskStatus(scope, taskId);
assert.equal(result.providerInstanceId, selection.instanceId);
assert.equal(result.model, selection.model);
assert.deepEqual(result.options, selection.options);
hasRun = false;
}
}).pipe(Effect.provide(layerOrchestratorService.pipe(Layer.provide(dependencies))));
}),
);
it.effect.each([
{ phase: "after restart", hasRun: true },
{ phase: "before launch", hasRun: false },
])("reports the child selection $phase with execution provenance when available", ({ hasRun }) =>
Effect.gen(function* () {
const runSelection = {
instanceId: ProviderInstanceId.make("claudeAgent-personal"),
model: "claude-opus-5-5",
options: [
{ id: "effort", value: "max" },
{ id: "fastMode", value: true },
],
} as const;
const threadSelection = {
instanceId: codexInstanceId,
model: "gpt-5.4",
options: [{ id: "reasoningEffort", value: "high" }],
} as const;
const child = idleThreadProjection(liveThreadShell(childThreadId));
const run = {
id: RunId.make("run:mcp-restarted-child"),
threadId: childThreadId,
ordinal: 1,
providerInstanceId: runSelection.instanceId,
modelSelection: runSelection,
observedModel: "claude-sonnet-5-5",
providerThreadId: null,
userMessageId: MessageId.make("message:mcp-restarted-child"),
rootNodeId: null,
activeAttemptId: null,
status: "running",
requestedAt: child.updatedAt,
startedAt: child.updatedAt,
completedAt: null,
checkpointId: null,
contextHandoffId: null,
} satisfies OrchestrationV2Run;
const task = {
id: taskId,
threadId: parentThreadId,
parentNodeId,
runId: null,
origin: "app_owned",
createdBy: "agent",
driver: ProviderDriverKind.make("claudeAgent"),
childThreadId,
providerThreadId: null,
nativeTaskRef: null,
prompt: "Review the implementation.",
title: null,
providerInstanceId: ProviderInstanceId.make("claudeAgent-work"),
model: "claude-sonnet-4-6",
status: "running",
result: null,
startedAt: child.updatedAt,
completedAt: null,
updatedAt: child.updatedAt,
} satisfies OrchestrationV2Subagent;
const parent = {
...idleThreadProjection(liveThreadShell(parentThreadId)),
subagents: [task],
};
const childWithRun = {
...child,
thread: { ...child.thread, modelSelection: threadSelection },
runs: hasRun ? [run] : [],
};
const dependencies = Layer.mergeAll(
NodeServices.layer,
Layer.mock(ThreadManagementService.ThreadManagementService)({
getThreadRecords: (id) => Effect.succeed(id === parentThreadId ? parent : childWithRun),
}),
ServerSettings.layerTest(),
providerRegistryLayer([]),
adapterRegistryLayer([]),
Layer.mock(ProjectService.ProjectService)({}),
Layer.mock(SecretRequests.SecretRequests)({}),
Layer.mock(RemoteDelegation.RemoteDelegation)({}),
Layer.mock(ScheduledTaskService.ScheduledTaskService)({}),
);
yield* Effect.gen(function* () {
const service = yield* OrchestratorMcpService.OrchestratorMcpService;
const result = yield* service.taskStatus(scope, taskId);

const selection = hasRun ? runSelection : threadSelection;
const observedModel = hasRun ? run.observedModel : undefined;

assert.equal(result.providerInstanceId, selection.instanceId);
assert.equal(result.model, observedModel ?? selection.model);
assert.equal(result.requestedModel, selection.model);
assert.equal(result.observedModel, observedModel);
assert.deepEqual(result.options, selection.options);
}).pipe(Effect.provide(layerOrchestratorService.pipe(Layer.provide(dependencies))));
}),
);
it.effect(
"inherits delegated options, merges overrides, and resets on explicit clearing or a new target",
() =>
Expand Down
17 changes: 13 additions & 4 deletions 17 apps/server/src/mcp/OrchestratorMcpService.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ function threadDetail(
): OrchestratorMcpThreadDetail {
const latest = ThreadManagementService.latestRun(projection);
const active = ThreadManagementService.latestActiveRun(projection);
const modelSelection =
latest?.observedModel == null ? projection.thread.modelSelection : latest.modelSelection;

return {
threadId: projection.thread.id,
projectId: projection.thread.projectId,
Expand All @@ -800,8 +803,10 @@ function threadDetail(
status: active?.status ?? latest?.status ?? "idle",
latestRunId: latest?.id ?? null,
activeRunId: active?.id ?? null,
providerInstanceId: projection.thread.modelSelection.instanceId,
model: projection.thread.modelSelection.model,
providerInstanceId: modelSelection.instanceId,
model: latest?.observedModel ?? modelSelection.model,
requestedModel: modelSelection.model,
...(latest?.observedModel == null ? {} : { observedModel: latest.observedModel }),
runtimeMode: projection.thread.runtimeMode,
interactionMode: projection.thread.interactionMode,
linkedPullRequest: projection.thread.linkedPullRequest ?? null,
Expand Down Expand Up @@ -837,7 +842,9 @@ function threadRun(run: OrchestrationV2Run): OrchestratorMcpThreadRun {
ordinal: run.ordinal,
status: run.status,
providerInstanceId: run.modelSelection.instanceId,
model: run.modelSelection.model,
model: run.observedModel ?? run.modelSelection.model,
requestedModel: run.modelSelection.model,
...(run.observedModel == null ? {} : { observedModel: run.observedModel }),
requestedAt: DateTime.formatIso(run.requestedAt),
startedAt: run.startedAt === null ? null : DateTime.formatIso(run.startedAt),
completedAt: run.completedAt === null ? null : DateTime.formatIso(run.completedAt),
Expand Down Expand Up @@ -1535,7 +1542,9 @@ const make = Effect.gen(function* () {
workState,
hasPendingChildRuns: hasPendingChildRuns(childProjection, childRun),
providerInstanceId: modelSelection.instanceId,
model: modelSelection.model,
model: childRun?.observedModel ?? modelSelection.model,
requestedModel: modelSelection.model,
...(childRun?.observedModel == null ? {} : { observedModel: childRun.observedModel }),
options: modelSelection.options ?? [],
summary: derivedResult,
resultContextTransferId,
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.