Skip to content
Merged
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
6 changes: 6 additions & 0 deletions packages/ui/src/features/canvas/hooks/useGenerateContext.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { DEFAULT_GATEWAY_MODEL } from "@posthog/agent/gateway-models";
import {
TASK_SERVICE,
type TaskService,
Expand Down Expand Up @@ -42,6 +43,11 @@ export function useGenerateContext(channelId: string, channelName: string) {
// test a local build of these features before merging.
workspaceMode,
allowNoRepo: true,
// A cloud run pairs a runtime adapter with a model, and the API
// rejects one without the other. Since this flow lets the agent pick
// its repo at runtime, it never surfaces a model picker, so pin the
// default gateway model here to match the adapter the saga defaults to.
model: DEFAULT_GATEWAY_MODEL,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Pinned Model Skips Gateway Resolution

When the gateway does not advertise claude-opus-4-8 for a user, org, or region, this flow still sends that fixed model instead of falling back through the existing model resolver. The generate-context run can then fail validation or startup even though the request now includes a model field.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Model Sent Without Adapter

This call now sends model: DEFAULT_GATEWAY_MODEL, but it still does not send the matching adapter. If the cloud API enforces the adapter/model pair the inline comment describes, the default cloud generate path can serialize runtime_adapter: null with a Claude model and be rejected before generation starts.

},
(output) => invalidateTasks(output.task),
);
Expand Down
Loading