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(opencode): project-defined models appear in that project's picker by juliusmarminge · Pull Request #24585 · pingdotgg/t3code

fix(opencode): project-defined models appear in that project's picker #24585

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

Merged
juliusmarminge merged 21 commits into main from fix/issue-24459
Nov 12, 2026

Uh oh!

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

Merged

fix(opencode): project-defined models appear in that project's picker #24585

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d7fa8ea
test(opencode): project-defined models reach the workspace snapshot (…
juliusmarminge Oct 30, 2026
d29b9e6
fix(opencode): project-defined models appear in that project's picker
juliusmarminge Oct 30, 2026
6d2e28a
fix(opencode): OpenCode 1 projects list their own models too
juliusmarminge Oct 30, 2026
08d8467
fix(opencode): an unreadable project catalog keeps its known models
juliusmarminge Oct 30, 2026
a605290
fix(mobile): new-task and hidden-model pickers use the draft's directory
juliusmarminge Oct 30, 2026
f4feb1c
fix(web): the model picker's open provider tab lists project models
juliusmarminge Oct 30, 2026
ca458db
Merge remote-tracking branch 'origin/main' into fix/issue-24459
juliusmarminge Oct 30, 2026
9cd1814
fix(server): project model discovery retries until it reads, and foll…
juliusmarminge Oct 30, 2026
ed8c778
Merge remote-tracking branch 'origin/main' into fix/issue-24459
juliusmarminge Oct 30, 2026
6ae13e7
fix(server): project models survive machine model changes and load in…
juliusmarminge Oct 30, 2026
f089347
fix(mobile): model picker scans only the provider in view
juliusmarminge Oct 30, 2026
eac44a1
fix(mobile): pulling to refresh the model picker rescans the project'…
juliusmarminge Oct 30, 2026
958a273
test(opencode): unreadable project catalogs stay pending on OpenCode …
juliusmarminge Oct 30, 2026
b91ce46
fix(server): a machine model change rescans every folder catalog
juliusmarminge Oct 30, 2026
fcd760e
Merge remote-tracking branch 'origin/main' into fix/issue-24459
juliusmarminge Nov 11, 2026
10e72ad
test(server): drop registry assertion the merge-snapshot test already…
juliusmarminge Nov 11, 2026
de8689f
Merge remote-tracking branch 'origin/main' into fix/issue-24459
juliusmarminge Nov 11, 2026
0303070
Merge branch 'main' into fix/issue-24459
juliusmarminge Nov 11, 2026
3291c06
Merge remote-tracking branch 'origin/main' into fix/issue-24459
juliusmarminge Nov 11, 2026
bd0f5cd
fix(web): the model picker says it is searching while a project's mod…
juliusmarminge Nov 11, 2026
b46a78c
Merge branch 'main' into fix/issue-24459
juliusmarminge Nov 12, 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

1 change: 1 addition & 0 deletions 1 apps/mobile/src/features/settings/ScheduledTaskPickerScreens.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function ScheduledTaskModelPickerRouteScreen() {
<ThreadSettingsPickerScreen
environmentId={editor.environmentId}
projectId={projectId}
cwd={null}
providerGroups={providerGroups}
selectedModel={selectedModel}
prompt={editor.draft.prompt}
Expand Down
8 changes: 2 additions & 6 deletions 8 apps/mobile/src/features/threads/NewTaskDraftScreen.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,6 @@ export function NewTaskDraftScreen(props: {
};
const cycleEnvironmentCommands = environments.length > 1 ? (["cycleHost"] as const) : [];
useHardwareKeyboardCommand(cycleEnvironmentCommands, cycleEnvironment);
const composerWorkspaceCwd =
(flow.workspaceMode === "worktree"
? selectedProject?.workspaceRoot
: (flow.selectedWorktreePath ?? selectedProject?.workspaceRoot)) || null;
const preventRemove =
(isIncomingShareHoldingRoute && !isProjectPickerReturnActive) || flow.submitting;
usePreventRemove(preventRemove, () => undefined);
Expand Down Expand Up @@ -971,7 +967,7 @@ export function NewTaskDraftScreen(props: {
<ThreadScreenBinding
environmentId={selectedProject.environmentId}
header={
<DraftThreadHeader thread={thread} project={selectedProject} cwd={composerWorkspaceCwd} />
<DraftThreadHeader thread={thread} project={selectedProject} cwd={flow.workspaceCwd} />
}
draftMode={{
content: heroViewport,
Expand Down Expand Up @@ -1012,7 +1008,7 @@ export function NewTaskDraftScreen(props: {
onCancelQueuedRunEdit={() => {}}
onRemoveQueuedEditAttachment={() => {}}
projectWorkspaceRoot={selectedProject.workspaceRoot}
threadCwd={composerWorkspaceCwd}
threadCwd={flow.workspaceCwd}
selectedThreadQueueCount={0}
queuedMessages={[]}
dispatchingMessageId={null}
Expand Down
8 changes: 6 additions & 2 deletions 8 apps/mobile/src/features/threads/ThreadComposer.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ import {
composerStripAttachments,
type DraftComposerFileAttachment,
} from "../../lib/composerImages";
import { buildModelOptions, isModelSelectionUnavailable } from "../../lib/modelOptions";
import {
buildModelOptions,
isModelSelectionUnavailable,
serverConfigForCwd,
} from "../../lib/modelOptions";
import { useScaledTextRole, type ScaledTextRole } from "../settings/appearance/useScaledTextRole";
import type { RemoteClientConnectionState } from "../../lib/connection";
import { MOBILE_TYPOGRAPHY } from "../../lib/typography";
Expand Down Expand Up @@ -715,7 +719,7 @@ export const ThreadComposer = function ThreadComposer(props: ThreadComposerProps
? undefined
: currentModelSelection.instanceId;
const modelOptions = buildModelOptions(
props.serverConfig,
serverConfigForCwd(props.serverConfig, props.projectCwd),
currentModelSelection,
lockedProviderInstanceId,
props.selectedThread.projectId,
Expand Down
75 changes: 64 additions & 11 deletions 75 apps/mobile/src/features/threads/ThreadSettingsSheet.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import * as Dialog from "../../components/ui/Dialog";
import { createV5StackNavigator as createNativeStackNavigator } from "../../native/createV5StackNavigator";
import { useSheetStackOptions } from "../layout/nested-stacks";
import { DEFAULT_SERVER_SETTINGS } from "@t3tools/contracts";
import { DEFAULT_SERVER_SETTINGS, ProviderInstanceId } from "@t3tools/contracts";
import {
modelPreferencesMigrationPatch,
resolveModelPreferences,
Expand All @@ -14,15 +14,14 @@ import type {
EnvironmentId,
ModelSelection,
ProjectId,
ProviderInstanceId,
ProviderOptionDescriptor,
ProviderOptionSelection,
RuntimeMode,
ServerSettings,
ThreadId,
} from "@t3tools/contracts";
import type { LegendListRenderItemProps } from "@legendapp/list/react-native";
import { RegistryContext, useAtomValue } from "@effect/atom-react";
import { RegistryContext, useAtomMount, useAtomValue } from "@effect/atom-react";
import { AnimatedLegendList } from "@legendapp/list/reanimated";
import {
getProviderOptionCurrentLabel,
Expand Down Expand Up @@ -65,6 +64,7 @@ import { useReduceMotionEnabled } from "../../lib/appState";
import {
buildModelOptions,
groupByProvider,
serverConfigForCwd,
type ModelOption,
type ProviderGroup,
} from "../../lib/modelOptions";
Expand All @@ -89,6 +89,8 @@ import { useQuietThreadStructure } from "../../state/use-thread-detail";
import { activeComposerDraftKey, useQueuedRunEdit } from "../../state/queued-run-edit";
import { selectThreadModel } from "../../state/thread-model-selection";
import { useThreadSelection } from "../../state/use-thread-selection";
import { useSelectedThreadWorktree } from "../../state/use-selected-thread-worktree";
import { providerWorkspaceSnapshotRefresh } from "../../state/provider-workspace-snapshot-refresh";
import { threadAllowsProviderSwitch } from "../../state/thread-provider-switching";
import { environmentServerConfigsAtom, serverEnvironment } from "../../state/server";
import { mobilePreferencesAtom } from "../../state/preferences";
Expand Down Expand Up @@ -257,6 +259,7 @@ type ThreadSettingsSubmenuPage =
type ThreadSettingsSessionProps = {
readonly environmentId: EnvironmentId | null;
readonly projectId: ProjectId | null;
readonly cwd: string | null;
readonly providerInstanceId?: ProviderInstanceId;
readonly lockedProviderInstanceId?: ProviderInstanceId;
readonly providerGroups: ReadonlyArray<ProviderGroup>;
Expand Down Expand Up @@ -312,6 +315,8 @@ type ThreadSettingsSessionValue = {
readonly setSearchQuery: (query: string) => void;
readonly setShowLegacy: (showLegacy: boolean) => void;
readonly toggleProvider: (providerKey: string) => void;
/** The provider whose catalog for this folder the picker keeps fresh. */
readonly workspaceScan: { readonly instanceId: ProviderInstanceId; readonly cwd: string } | null;
};

const ThreadSettingsSessionContext = createContext<ThreadSettingsSessionValue | null>(null);
Expand All @@ -338,7 +343,7 @@ function ThreadSettingsSessionProvider(
manageHidden && config
? groupByProvider(
buildModelOptions(
config,
serverConfigForCwd(config, props.cwd),
props.selectedModel,
props.lockedProviderInstanceId,
props.projectId,
Expand Down Expand Up @@ -589,8 +594,17 @@ function ThreadSettingsSessionProvider(
);
};

const environmentId = props.environmentId;
// Like the web picker's open tab: scanning every provider would spawn a probe per provider.
const scannedInstanceId =
providerFilter !== null && providerFilter !== FAVORITES_PROVIDER_FILTER
? ProviderInstanceId.make(providerFilter)
: props.providerInstanceId;
const workspaceScan =
props.cwd && scannedInstanceId ? { instanceId: scannedInstanceId, cwd: props.cwd } : null;

const value = {
environmentId: props.environmentId,
environmentId,
providerInstanceId: props.providerInstanceId,
providerGroups,
manageHidden,
Expand Down Expand Up @@ -622,15 +636,34 @@ function ThreadSettingsSessionProvider(
setShowLegacy: setShowLegacyToggle,
toggleProvider,
toggleFavorite,
workspaceScan,
} satisfies ThreadSettingsSessionValue;

return (
<ThreadSettingsSessionContext.Provider value={value}>
{environmentId && workspaceScan ? (
<ProviderWorkspaceSnapshotScan
key={workspaceScan.instanceId}
environmentId={environmentId}
instanceId={workspaceScan.instanceId}
cwd={workspaceScan.cwd}
/>
) : null}
{props.children}
</ThreadSettingsSessionContext.Provider>
);
}

/** A project's own provider config can add models only its workspace scan lists. */
function ProviderWorkspaceSnapshotScan(props: {
readonly environmentId: EnvironmentId;
readonly instanceId: ProviderInstanceId;
readonly cwd: string;
}) {
useAtomMount(providerWorkspaceSnapshotRefresh(props));
return null;
}

function useThreadSettingsSession() {
const value = use(ThreadSettingsSessionContext);
if (!value) {
Expand Down Expand Up @@ -927,11 +960,25 @@ function ThreadSettingsMainContent(props: {
const refreshProviders = () => {
if (!session.environmentId || isRefreshingProviders) return;
setIsRefreshingProviders(true);
void refreshProviderCatalog(session.environmentId).then((result) => {
setIsRefreshingProviders(false);
const error = providerCatalogRefreshError(result);
if (error) Dialog.alert("Could not refresh models", error);
});
const environmentId = session.environmentId;
const workspaceScan = session.workspaceScan;
void refreshProviderCatalog(environmentId)
.then(async (result) => {
// A project's own models are read per folder, so the machine refresh alone keeps them stale.
// A failed folder read keeps its previous models and retries, so only the machine result alerts.
if (result._tag === "Success" && workspaceScan) {
await refreshProvidersCommand({
environmentId,
input: { ...workspaceScan, fresh: true },
});
}
return result;
})
.then((result) => {
setIsRefreshingProviders(false);
const error = providerCatalogRefreshError(result);
if (error) Dialog.alert("Could not refresh models", error);
});
};
const [listLoaded, setListLoaded] = useState(false);
// Android can drop the first frame of a reduced-motion fade, leaving rows invisible.
Expand Down Expand Up @@ -1313,6 +1360,7 @@ export function ExistingThreadSettingsRouteScreen({
// Reads the same environmentId/threadId params as the Thread route beneath it.
const { selectedThread, selectedThreadDetailRef, selectedEnvironmentRuntime } =
useThreadSelection();
const { selectedThreadCwd } = useSelectedThreadWorktree();
// Streamed text would otherwise re-render the whole model picker on every delta.
const structure = useQuietThreadStructure(selectedThreadDetailRef);
const reportedModelSelection = useThreadReportedModelSelection(selectedThreadDetailRef);
Expand All @@ -1327,7 +1375,10 @@ export function ExistingThreadSettingsRouteScreen({
return <View className="flex-1 bg-sheet" />;
}

const serverConfig = selectedEnvironmentRuntime?.serverConfig ?? null;
const serverConfig = serverConfigForCwd(
selectedEnvironmentRuntime?.serverConfig ?? null,
selectedThreadCwd,
);
const modelSelection = draftSettings.modelSelection ?? selectedThread.modelSelection;
const lockedProviderInstanceId = threadAllowsProviderSwitch({
thread: selectedThread,
Expand All @@ -1354,6 +1405,7 @@ export function ExistingThreadSettingsRouteScreen({
<ThreadSettingsPickerScreen
environmentId={selectedThread.environmentId}
projectId={selectedThread.projectId}
cwd={selectedThreadCwd}
providerInstanceId={modelSelection.instanceId}
{...(lockedProviderInstanceId ? { lockedProviderInstanceId } : {})}
providerGroups={groupByProvider(modelOptions)}
Expand Down Expand Up @@ -1391,6 +1443,7 @@ export function NewTaskThreadSettingsRouteScreen() {
<ThreadSettingsPickerScreen
environmentId={flow.selectedEnvironmentId}
projectId={flow.selectedProject?.id ?? null}
cwd={flow.workspaceCwd}
{...(flow.selectedModel ? { providerInstanceId: flow.selectedModel.instanceId } : {})}
providerGroups={flow.providerGroups}
selectedModel={flow.selectedModel}
Expand Down
14 changes: 13 additions & 1 deletion 14 apps/mobile/src/features/threads/new-task-flow-provider.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
resolveDefaultableModelSelection,
resolveNewTaskModelSelection,
resolveSelectableModelSelection,
serverConfigForCwd,
} from "../../lib/modelOptions";
import { scopedProjectKey } from "../../lib/scopedEntities";
import { useAtomValue } from "@effect/atom-react";
Expand Down Expand Up @@ -137,6 +138,8 @@ type NewTaskFlowContextValue = {
readonly canChooseWorkspace: boolean;
readonly selectedBranchName: string | null;
readonly selectedWorktreePath: string | null;
/** Where the draft's agent will run: the selected worktree, else the project root. */
readonly workspaceCwd: string | null;
readonly resolveWorkspaceSelection: (
selection: ComposerDraftWorkspaceSelection | undefined,
) => ComposerDraftWorkspaceSelection;
Expand Down Expand Up @@ -324,7 +327,6 @@ export function NewTaskFlowProvider(
const storedStickyModelSelection = useStickyComposerModelSelection();
const modelSelectionNow = useNowMinuteMs();
const projectDefaults = useNewTaskProjectDefaults(selectedProject);
const selectedEnvironmentServerConfig = projectDefaults.serverConfig;
const isScratchDraft = projectDefaults.isScratch;
const serverConfigs = useServerConfigs();
const { connectedEnvironments } = useRemoteConnectionStatus();
Expand Down Expand Up @@ -404,6 +406,15 @@ export function NewTaskFlowProvider(
const workspaceMode = workspaceSelection.mode;
const selectedBranchName = workspaceSelection.branch;
const selectedWorktreePath = workspaceSelection.worktreePath;
// A new worktree does not exist yet, so the project root stands in for it.
const workspaceCwd =
(workspaceMode === "worktree"
? selectedProject?.workspaceRoot
: (selectedWorktreePath ?? selectedProject?.workspaceRoot)) || null;
const selectedEnvironmentServerConfig = serverConfigForCwd(
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

Uh oh!

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

projectDefaults.serverConfig,
workspaceCwd,
);
// Keep the user's explicit choice separate from the resolved display value:
// only the explicit flag is ever written back to the draft, so the resolved
// value keeps tracking the server setting when the config loads late.
Expand Down Expand Up @@ -831,6 +842,7 @@ export function NewTaskFlowProvider(
canChooseWorkspace,
selectedBranchName,
selectedWorktreePath,
workspaceCwd,
resolveWorkspaceSelection,
startFromOrigin,
draftKey: selectedProjectDraftKey,
Expand Down
8 changes: 1 addition & 7 deletions 8 apps/mobile/src/features/threads/use-composer-command-menu.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import {
scoreQueryMatch,
} from "@t3tools/shared/searchRanking";
import {
createProviderWorkspaceSnapshotRefreshAtomFamily,
dedupeProviderSkillsByName,
getProviderSkillsForSlashMenu,
getProviderSlashCommandsForSlashMenu,
Expand All @@ -58,7 +57,7 @@ import { Atom } from "effect/reactivity";
import { useEffect, useState } from "react";

import type { ComposerEditorSelection } from "../../components/ComposerEditor";
import { serverEnvironment } from "../../state/server";
import { providerWorkspaceSnapshotRefresh } from "../../state/provider-workspace-snapshot-refresh";
import {
useComposerPathSearch,
useComposerPullRequestSearch,
Expand All @@ -68,11 +67,6 @@ import type { ModelOption } from "../../lib/modelOptions";
import type { ComposerCommandItem } from "./ComposerCommandPopover";
import { matchesSlashSkillQuery } from "./composerSlashSkillSearch";

const providerWorkspaceSnapshotRefresh = createProviderWorkspaceSnapshotRefreshAtomFamily({
providers: serverEnvironment.providersValueAtom,
refreshProviders: serverEnvironment.refreshProviders,
});

const idleWorkspaceSnapshotRefreshAtom: Atom.Atom<unknown> = Atom.make<void>(undefined).pipe(
Atom.withLabel("mobile:provider-workspace-snapshot-refresh:idle"),
);
Expand Down
11 changes: 11 additions & 0 deletions 11 apps/mobile/src/lib/modelOptions.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
getProviderOptionDescriptors,
} from "@t3tools/shared/model";
import { resolveModelShortName } from "@t3tools/client-runtime/provider-clients";
import { resolveProvidersForCwd } from "@t3tools/client-runtime/providerSkills";

export type ModelOption = {
readonly key: string;
Expand Down Expand Up @@ -159,6 +160,16 @@ function normalizeSelectionOptions(
};
}

/** The config as a project at `cwd` sees it, with that project's own provider models. */
export function serverConfigForCwd<C extends T3ServerConfig | null | undefined>(
config: C,
cwd: string | null,
): C {
if (!config) return config;
const providers = resolveProvidersForCwd(config.providers, cwd);
return providers === config.providers ? config : { ...config, providers };
}

/** Require explicit projectId or null so omissions cannot bypass project provider disablement. */
export function isModelSelectionUnavailable(
config: T3ServerConfig | null | undefined,
Expand Down
9 changes: 9 additions & 0 deletions 9 apps/mobile/src/state/provider-workspace-snapshot-refresh.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createProviderWorkspaceSnapshotRefreshAtomFamily } from "@t3tools/client-runtime/providerSkills";

import { serverEnvironment } from "./server";

/** Shared by the composer and the model picker so one cwd scans once. */
export const providerWorkspaceSnapshotRefresh = createProviderWorkspaceSnapshotRefreshAtomFamily({
providers: serverEnvironment.providersValueAtom,
refreshProviders: serverEnvironment.refreshProviders,
});
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.