Repository navigation
feat(core): choose tools and Code Mode placement from the session's model #64515
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.
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,16 @@ export class ModelUnavailableError extends Schema.TaggedError<ModelUnavailableEr | |
| } | ||
| export type Error = ModelNotSelectedError | ModelUnavailableError | ModelResolver.Error | ||
| export type Resolved = ModelResolver.Resolved | ||
| export type Selected = { | ||
| readonly info: Model.Info | ||
| readonly variant: Model.VariantID | undefined | ||
| } | ||
|
|
||
| export interface Interface { | ||
| readonly select: ( | ||
| session: SessionSchema.Info, | ||
| available: () => Effect.Effect<ReadonlyArray<Model.Info>>, | ||
| ) => Effect.Effect<Selected, ModelNotSelectedError | ModelUnavailableError> | ||
| /** Availability is sampled lazily for each explicitly selected model resolution. */ | ||
| readonly resolve: ( | ||
| session: SessionSchema.Info, | ||
|
|
@@ -99,6 +107,7 @@ const layer = Layer.effect( | |
| return yield* new ModelNotSelectedError({ sessionID: session.id }) | ||
| }) | ||
| return Service.of({ | ||
| select, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. opencode bot why did search need to be exported here?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm reading "search" as
The alternative is to keep One trade-off: when a hook sends the session to a different model family, tools still follow the model the user picked. That's what the PR description says ("hook still runs in I only read the code and didn't run anything. I made no changes; the only local change in the checkout is a |
||
| resolve: Effect.fn("SessionRunnerModel.resolve")(function* (session, available, request) { | ||
| const selected = yield* select(session, available) | ||
| const ref = Model.Ref.make({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This picks tools from the model before
experimental.model.resolveruns. The removed patch hook sawevent.model, the resolved model. For Copilot "auto", the model here isauto, which is neither GPT nor Claude. Those sessions now always get edit/write and no Code Mode, even when the request is routed to a GPT model that previously gotpatch. If that's intended, it's worth noting. Otherwise the Copilot route could be resolved first, orautohandled explicitly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I know
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Since the Copilot
auto→edit/write, no Code Mode behaviour is intended, it would help to add it to the PR description's "Known open items" next to theexplorenote. That way reviewers won't flag it again. I haven't changed anything in the checkout.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fu