Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
f00b461
Add Copilot SDK support
zortos293 Apr 18, 2026
743aa71
Include copilot in provider registry test
zortos293 Apr 18, 2026
8a0431f
Guard Copilot session bootstrap callbacks
zortos293 Apr 18, 2026
d93faeb
Refactor Copilot adapter to use Effect deferreds
zortos293 Apr 20, 2026
a2f94a0
Use copilot icon in model picker
zortos293 Apr 20, 2026
28be1d0
Reuse Copilot git text clients
zortos293 Apr 20, 2026
b6de891
Delete apps/web/src/components/chat/providerIconUtils.test.ts
zortos293 Apr 20, 2026
3cb707b
Render Copilot task completion as assistant text
zortos293 Apr 22, 2026
6892fcd
Complete Copilot send failure lifecycle
zortos293 May 7, 2026
ed4c30d
Fix Copilot rebase fallout
zortos293 May 7, 2026
cbe235f
Remove unused Copilot provider service
zortos293 May 8, 2026
ab72e4c
Handle empty Copilot tool progress messages
zortos293 May 11, 2026
10bf620
Emit Copilot fallback message for tool-only turns
zortos293 May 16, 2026
7eca7d6
Fix Copilot integration after main rebase
huxcrux May 31, 2026
470b28a
Handle invalid Copilot CLI paths safely
huxcrux May 31, 2026
7ff1527
Refine Copilot provider auth labels
huxcrux May 31, 2026
8059cac
Preserve Copilot auth status labels
huxcrux Jun 1, 2026
2bb4d2a
Adapt Copilot changes to latest main
huxcrux Jun 8, 2026
666793b
Fix Copilot CLI launch in desktop
huxcrux Jun 8, 2026
468794d
Update Copilot SDK runtime integration
huxcrux Jun 8, 2026
a916228
Add Copilot context window selection
huxcrux Jun 8, 2026
735711c
Label Copilot none reasoning effort
huxcrux Jun 8, 2026
038d5a0
Refresh Copilot provider timestamps
huxcrux Jun 8, 2026
4df2947
Clear Copilot permission bindings on reply
huxcrux Jun 8, 2026
6d69312
Drain Copilot events before teardown
huxcrux Jun 8, 2026
aad7c03
Clean up Copilot regression tests
huxcrux Jun 8, 2026
79bc3f0
Add Copilot max reasoning effort
huxcrux Jun 8, 2026
b5161da
Align Copilot command tool rendering
huxcrux Jun 8, 2026
a0fb1a6
fix(web): stabilize context window snapshots
huxcrux Jun 8, 2026
9baa0c1
Handle stale Copilot resume cursors
huxcrux Jun 8, 2026
806d96e
Emit Copilot file-change turn diffs
huxcrux Jun 8, 2026
44037e0
Skip Copilot first-turn text generation
huxcrux Jun 8, 2026
227c0d8
Propagate thread metadata shell updates
huxcrux Jun 8, 2026
fc87f9d
Warn on Copilot mode sync failures
huxcrux Jun 8, 2026
2a013d9
Fix Copilot approval resolution
huxcrux Jun 9, 2026
5e55227
Ensure Copilot task completions snapshot diffs
huxcrux Jun 9, 2026
5d50003
Fix first-turn title generation draining
huxcrux Jun 10, 2026
130f82b
Align Copilot provider format
huxcrux Jun 11, 2026
836bb3d
Wire Copilot tasks into task list
huxcrux Jun 11, 2026
00b4934
Handle missing Copilot background task list
huxcrux Jun 11, 2026
8d7d7f5
Fix Copilot diff markers
huxcrux Jun 11, 2026
129f9b6
Filter Copilot command-only completion fallback
huxcrux Jun 11, 2026
1816021
Filter Copilot task-agent completion fallback
huxcrux Jun 11, 2026
feab8d2
Filter Copilot task-completed generic fallback
huxcrux Jun 11, 2026
aada078
Stop emitting empty Copilot diffs
huxcrux Jun 12, 2026
9bd32b7
Normalize Copilot user input answers
huxcrux Jun 12, 2026
dfe699b
Stream Copilot fallback assistant text
huxcrux Jun 12, 2026
55a21a4
Add Copilot provider refs
huxcrux Jun 12, 2026
d0ac4cc
Share provider tool classification
huxcrux Jun 12, 2026
fa6b682
Normalize provider plan updates
huxcrux Jun 12, 2026
60d8c5c
Project provider reasoning deltas
huxcrux Jun 12, 2026
f72bc79
Project provider tool output deltas
huxcrux Jun 12, 2026
3b12f67
Guard duplicate Copilot completions
huxcrux Jun 12, 2026
d01f19d
Fix queued Copilot turn idle handling
huxcrux Jun 13, 2026
768dcf8
Suppress Copilot generic completion fallbacks
huxcrux Jun 14, 2026
d420756
Trigger Copilot diff checkpoints for tool completions
huxcrux Jun 14, 2026
5917005
Make checkpoint revert rollback-safe
huxcrux Jun 14, 2026
61905f7
Restore Copilot first-turn branch naming
huxcrux Jun 14, 2026
9ac833d
Filter empty Copilot diff turns
huxcrux Jun 14, 2026
53b6df8
Ignore Copilot shell completion lines in diffs
huxcrux Jun 14, 2026
6452283
Fix Copilot session error turn completion
huxcrux Jun 14, 2026
e2aab96
Fix Copilot adapter formatting
huxcrux Jun 14, 2026
d2cb1b0
Fix web search approval classification
huxcrux Jun 14, 2026
4e87af8
Fix checkpoint revert rollback ordering
huxcrux Jun 14, 2026
3616cb7
Fix file-read tool name classification
huxcrux Jun 14, 2026
a801f47
Invalidate workspace cache on rollback recovery failure
huxcrux Jun 14, 2026
e9bd573
Fix Copilot provider permission handling
huxcrux Jun 15, 2026
45e8882
Fix Copilot runtime after rebase
huxcrux Jun 15, 2026
228c905
Fix Copilot review issues
huxcrux Jun 15, 2026
285910c
Fix Copilot test vitest imports
huxcrux Jun 15, 2026
5e061d6
Fix Copilot mock test imports
huxcrux Jun 15, 2026
ba2414e
fix copilot settings patch trimming
huxcrux Jun 16, 2026
47015f1
Use active turn IDs for Copilot diffs
huxcrux Jun 16, 2026
f32d65d
Tighten composer prompt effort descriptors
huxcrux Jun 16, 2026
e34a588
Handle provider completions without turn ids
huxcrux Jun 18, 2026
3b47f19
Normalize Copilot tool lifecycle classification
huxcrux Jun 18, 2026
5ff2184
Render Copilot task completion as assistant text
huxcrux Jun 18, 2026
5b15ff8
Fix Copilot adapter test formatting
huxcrux Jun 18, 2026
0c0ae9b
Refactor Copilot provider cleanup helpers
huxcrux Jun 18, 2026
90f20ab
Mark Copilot provider early access
huxcrux Jun 18, 2026
6397708
Clean up Copilot adapter internals
huxcrux Jun 18, 2026
eae8db7
Fix provider review issues
huxcrux Jun 19, 2026
c5d911c
Fix CI review follow-ups
huxcrux Jun 19, 2026
7626c62
Fix unscoped provider turn completion
huxcrux Jun 19, 2026
9f0d5cd
Fix Copilot task and abort event handling
huxcrux Jun 19, 2026
c169d87
fix: align copilot branch with latest main
huxcrux Jun 30, 2026
1a1cc8a
fix: match mobile title seed truncation
huxcrux Jun 30, 2026
4706da2
fix: address copilot review feedback
huxcrux Jun 30, 2026
dfdc13d
fix: address copilot follow-up review
huxcrux Jun 30, 2026
543123b
fix: address copilot review follow-ups
huxcrux Jun 30, 2026
00c5f1f
fix: structure copilot cli resolution errors
huxcrux Jun 30, 2026
44c11a7
fix: address copilot runtime review comments
huxcrux Jun 30, 2026
a9aa6f4
fix: align copilot binary path resolution
huxcrux Jun 30, 2026
718c6ba
Add Copilot text generation context tier
huxcrux Jul 1, 2026
229b438
Skip Copilot first-turn title generation
huxcrux Jul 1, 2026
8fb57e2
Move Copilot title fallback into provider
huxcrux Jul 1, 2026
1f207c2
Fix Copilot follow-up turn completion
huxcrux Jul 3, 2026
30c866a
Address Copilot provider review comments
huxcrux Jul 3, 2026
3efc417
Fix Copilot text generation formatting
huxcrux Jul 3, 2026
f6fcc44
refine copilot lifecycle and remove stale awareness fallback
huxcrux Jul 6, 2026
56d5b3c
Harden provider runtime lifecycle handling
huxcrux Jul 6, 2026
d3238af
Fix review feedback on turn completion guards
huxcrux Jul 6, 2026
fd17f3f
Fix Copilot probe error message and flaky idle test
huxcrux Jul 6, 2026
618f59c
Unwrap Copilot probe wrapper errors for status
huxcrux Jul 6, 2026
80d2638
fix leftover merge markers in agent awareness test
huxcrux Jul 7, 2026
3e96238
Fix 8 code review issues on Copilot provider PR
huxcrux Jul 7, 2026
ed98701
fix(copilot): fail startupDeferred on client init error and guard sha…
huxcrux Jul 7, 2026
c370fe2
fix(copilot): fix backgroundTasks RPC property name and contextTier f…
huxcrux Jul 7, 2026
169fea4
Fix Copilot background task listing
huxcrux Jul 7, 2026
d194218
Address Copilot Effect review comments
huxcrux Jul 7, 2026
7cc94f6
Fix Copilot text generation formatting
huxcrux Jul 7, 2026
903b8c2
Fix Copilot test Effect imports
huxcrux Jul 7, 2026
46e2966
Fix Copilot review findings
huxcrux Jul 12, 2026
8770677
fix: stabilize Copilot tool activity IDs
huxcrux Jul 13, 2026
5f3f6b5
fix(server): preserve active Copilot turn on queued send failure
huxcrux Jul 13, 2026
ddb15d6
fix(copilot): activate queued turns when SDK starts
huxcrux Jul 13, 2026
02a7988
fix(copilot): support conversation rollback
huxcrux Jul 13, 2026
30fa713
fix(copilot): require mode sync before sending
huxcrux Jul 13, 2026
b3a00d5
fix(server): run first-turn metadata jobs concurrently
huxcrux Jul 13, 2026
b4977c4
perf(server): stop persisting streamed tool deltas
huxcrux Jul 13, 2026
c70d274
fix(copilot): separate call usage from context usage
huxcrux Jul 13, 2026
72aacff
fix(server): align bundled Copilot CLI version
huxcrux Jul 13, 2026
6516424
test(copilot): type mocked send responses
huxcrux Jul 13, 2026
ad70a3e
fix(copilot): coalesce text client startup
huxcrux Jul 13, 2026
5f06820
refactor(copilot): remove unused delta emissions
huxcrux Jul 13, 2026
436312f
refactor(copilot): keep client-seeded thread titles
huxcrux Jul 13, 2026
8d4ebc0
fix(server): address Copilot review feedback
huxcrux Jul 13, 2026
a66e39e
test(server): synchronize provider settings watcher
huxcrux Jul 13, 2026
40cfe7d
fix(server): harden copilot rollback and settings watching
huxcrux Jul 13, 2026
b0631f9
fix(copilot): serialize rollback history mutations
huxcrux Jul 13, 2026
b9ef000
fix(copilot): harden rollback shutdown ordering
huxcrux Jul 13, 2026
040030b
fix(copilot): serialize session replacement teardown
huxcrux Jul 13, 2026
79f94eb
fix(copilot): serialize per-thread session lifecycle
huxcrux Jul 13, 2026
4740f2f
fix(copilot): coalesce concurrent session stops
huxcrux Jul 13, 2026
ba8d61a
fix(copilot): stop the current serialized session
huxcrux Jul 13, 2026
29ab19d
test(cursor): wait for ACP request log writes
huxcrux Jul 13, 2026
c612c3f
fix(copilot): harden provider lifecycle
huxcrux Jul 14, 2026
b41a327
fix(copilot): complete failed tool turns
huxcrux Jul 14, 2026
2c07a93
fix(providers): recover stale instance selections
huxcrux Jul 14, 2026
c11a469
fix(copilot): reduce work log noise
huxcrux Jul 14, 2026
651ff66
chore(copilot): update CLI and SDK packages
huxcrux Jul 14, 2026
7f59363
fix(copilot): address review follow-ups
huxcrux Jul 14, 2026
b6deabf
fix(copilot): debounce successful tool completion
huxcrux Jul 14, 2026
b1b11e8
fix(copilot): preserve rejected turn completion
huxcrux Jul 14, 2026
17d1aa0
feat(copilot): generate summarized thread titles
huxcrux Jul 15, 2026
a5a227c
feat(plans): render status-aware task lists
huxcrux Jul 15, 2026
d2c918d
fix(plans): prioritize named task sections
huxcrux Jul 15, 2026
c360618
fix(plans): isolate task list groups
huxcrux Jul 15, 2026
5a68ce8
fix(plans): consolidate task section fragments
huxcrux Jul 15, 2026
9c63d2a
fix(copilot): preserve custom thread titles
huxcrux Jul 15, 2026
eb7b4fb
refactor(copilot): narrow provider integration scope
huxcrux Jul 15, 2026
dbe1f34
fix(server): subscribe before watching provider settings
huxcrux Jul 15, 2026
3dffaee
fix(server): replay latest settings snapshot
huxcrux Jul 15, 2026
c6d8898
fix(copilot): address lifecycle review findings
huxcrux Jul 15, 2026
5e461d8
fix(copilot): structure client stop failures
huxcrux Jul 15, 2026
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
2 changes: 2 additions & 0 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"@effect/platform-node-shared": "catalog:",
"@effect/sql-sqlite-bun": "catalog:",
"@ff-labs/fff-node": "0.9.4",
"@github/copilot": "1.0.69",
"@github/copilot-sdk": "1.0.6",
"@opencode-ai/sdk": "^1.3.15",
"@pierre/diffs": "catalog:",
"effect": "catalog:",
Expand Down
161 changes: 161 additions & 0 deletions apps/server/src/provider/Drivers/CopilotDriver.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
/**
* CopilotDriver — `ProviderDriver` for the GitHub Copilot SDK runtime.
*
* Mirrors the other provider drivers: a plain value whose `create()` returns
* one `ProviderInstance` bundling `snapshot` / `adapter` / `textGeneration`
* closures captured over the per-instance `CopilotSettings`.
*
* Each instance owns an isolated Copilot home directory under server state and
* a per-instance SDK client, so sessions and persisted cursors do not leak
* across configured Copilot providers.
*
* @module provider/Drivers/CopilotDriver
*/
import { CopilotSettings, ProviderDriverKind, type ServerProvider } from "@t3tools/contracts";
import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
import type * as Context from "effect/Context";
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Path from "effect/Path";
import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
import * as FileSystem from "effect/FileSystem";

import { makeCopilotTextGeneration } from "../../textGeneration/CopilotTextGeneration.ts";
import { ServerConfig } from "../../config.ts";
import { ProviderDriverError } from "../Errors.ts";
import { makeCopilotAdapter } from "../Layers/CopilotAdapter.ts";
import {
checkCopilotProviderStatus,
makePendingCopilotProvider,
} from "../Layers/CopilotProvider.ts";
import { ProviderEventLoggers } from "../Layers/ProviderEventLoggers.ts";
import { makeManagedServerProvider } from "../makeManagedServerProvider.ts";
import {
defaultProviderContinuationIdentity,
type ProviderDriver,
type ProviderInstance,
} from "../ProviderDriver.ts";
import type { ServerProviderDraft } from "../providerSnapshot.ts";
import { mergeProviderInstanceEnvironment } from "../ProviderInstanceEnvironment.ts";
import { makeManualOnlyProviderMaintenanceCapabilities } from "../providerMaintenance.ts";

const DRIVER_KIND = ProviderDriverKind.make("copilot");
const SNAPSHOT_REFRESH_INTERVAL = Duration.hours(1);
const decodeCopilotSettings = Schema.decodeSync(CopilotSettings);

export type CopilotDriverEnv =
Comment thread
macroscopeapp[bot] marked this conversation as resolved.
| FileSystem.FileSystem
| Path.Path
| Context.Service.Identifier<typeof HostProcessPlatform>
| ProviderEventLoggers
| ServerConfig;

const withInstanceIdentity =
(input: {
readonly instanceId: ProviderInstance["instanceId"];
readonly displayName: string | undefined;
readonly accentColor: string | undefined;
readonly continuationGroupKey: string;
}) =>
(snapshot: ServerProviderDraft): ServerProvider => ({
...snapshot,
instanceId: input.instanceId,
driver: DRIVER_KIND,
...(input.displayName ? { displayName: input.displayName } : {}),
...(input.accentColor ? { accentColor: input.accentColor } : {}),
continuation: { groupKey: input.continuationGroupKey },
});

export const CopilotDriver: ProviderDriver<CopilotSettings, CopilotDriverEnv> = {
driverKind: DRIVER_KIND,
metadata: {
displayName: "GitHub Copilot",
supportsMultipleInstances: true,
},
configSchema: CopilotSettings,
defaultConfig: (): CopilotSettings => decodeCopilotSettings({}),
create: ({ instanceId, displayName, accentColor, environment, enabled, config }) =>
Effect.gen(function* () {
const serverConfig = yield* ServerConfig;
const eventLoggers = yield* ProviderEventLoggers;
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const processEnv = mergeProviderInstanceEnvironment(environment);
const effectiveConfig = { ...config, enabled } satisfies CopilotSettings;
const baseDirectory = path.join(serverConfig.stateDir, "providers", "copilot", instanceId);
const continuationIdentity = defaultProviderContinuationIdentity({
driverKind: DRIVER_KIND,
instanceId,
});
const stampIdentity = withInstanceIdentity({
instanceId,
displayName,
accentColor,
continuationGroupKey: continuationIdentity.continuationKey,
});
const maintenanceCapabilities = makeManualOnlyProviderMaintenanceCapabilities({
provider: DRIVER_KIND,
packageName: "@github/copilot",
});
yield* fileSystem.makeDirectory(baseDirectory, { recursive: true }).pipe(
Effect.mapError(
(cause) =>
new ProviderDriverError({
driver: DRIVER_KIND,
instanceId,
detail: `Failed to prepare Copilot home: ${cause.message ?? String(cause)}`,
cause,
}),
),
);

const adapter = yield* makeCopilotAdapter(effectiveConfig, {
instanceId,
baseDirectory,
environment: processEnv,
...(eventLoggers.native ? { nativeEventLogger: eventLoggers.native } : {}),
});
const textGeneration = yield* makeCopilotTextGeneration(effectiveConfig, processEnv, {
baseDirectory,
});

const snapshot = yield* makeManagedServerProvider<CopilotSettings>({
maintenanceCapabilities,
getSettings: Effect.succeed(effectiveConfig),
streamSettings: Stream.never,
haveSettingsChanged: () => false,
initialSnapshot: (settings) =>
Effect.succeed(stampIdentity(makePendingCopilotProvider(settings))),
checkProvider: checkCopilotProviderStatus({
settings: effectiveConfig,
cwd: serverConfig.cwd,
baseDirectory,
environment: processEnv,
}).pipe(Effect.map(stampIdentity)),
refreshInterval: SNAPSHOT_REFRESH_INTERVAL,
}).pipe(
Effect.mapError(
(cause) =>
new ProviderDriverError({
driver: DRIVER_KIND,
instanceId,
detail: `Failed to build Copilot snapshot: ${cause.message ?? String(cause)}`,
cause,
}),
),
);

return {
instanceId,
driverKind: DRIVER_KIND,
continuationIdentity,
displayName,
accentColor,
enabled,
snapshot,
adapter,
textGeneration,
} satisfies ProviderInstance;
}),
};
Loading
Loading