Skip to content

Commit adcbfca

Browse files
committed
fix: Use Bearer token for copilot authorization and remove logger.
1 parent 0e98c05 commit adcbfca

File tree

3 files changed

+1
-110
lines changed

3 files changed

+1
-110
lines changed

src/lib/api-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const COPILOT_API_CONFIG = {
1111

1212
export const COPILOT_API_BASE_URL = "https://api.individual.githubcopilot.com"
1313
export const copilotHeaders = (state: State) => ({
14-
Authorization: `token ${state.copilotToken}`,
14+
Authorization: `Bearer ${state.copilotToken}`,
1515
"copilot-integration-id": "vscode-chat",
1616
})
1717

src/lib/logger.ts

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/main.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { defineCommand, runMain } from "citty"
44
import consola from "consola"
55
import { serve, type ServerHandler } from "srvx"
66

7-
import { logger } from "./lib/logger"
87
import { cacheModels } from "./lib/models"
98
import { ensurePaths } from "./lib/paths"
109
import { setupCopilotToken, setupGitHubToken } from "./lib/token"
@@ -13,7 +12,6 @@ import { server } from "./server"
1312
interface RunServerOptions {
1413
port: number
1514
verbose: boolean
16-
logFile?: string
1715
}
1816

1917
export async function runServer(options: RunServerOptions): Promise<void> {
@@ -22,8 +20,6 @@ export async function runServer(options: RunServerOptions): Promise<void> {
2220
consola.info("Verbose logging enabled")
2321
}
2422

25-
await logger.initialize(options.logFile)
26-
2723
await ensurePaths()
2824
await setupGitHubToken()
2925
await setupCopilotToken()
@@ -52,18 +48,13 @@ const main = defineCommand({
5248
default: false,
5349
description: "Enable verbose logging",
5450
},
55-
"log-file": {
56-
type: "string",
57-
description: "File to log request/response details",
58-
},
5951
},
6052
run({ args }) {
6153
const port = Number.parseInt(args.port, 10)
6254

6355
return runServer({
6456
port,
6557
verbose: args.verbose,
66-
logFile: args["log-file"],
6758
})
6859
},
6960
})

0 commit comments

Comments
 (0)