[codex] 修复 Coding Agents 的 Codex 启动和代理隔离 (#1123)
* feat: add coding agent install status * chore: add latest claude opus model preset * feat: add coding agent config editing * Add scoped coding agent launch proxy * Add Codex proxy plan * fix coding agents codex launch proxy * fix codex catalog context test --------- Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import Router from '@koa/router'
|
||||
import { claudeProxyMessages, claudeProxyModels } from '../services/claude-code-proxy'
|
||||
|
||||
export const claudeCodeProxyRoutes = new Router()
|
||||
|
||||
claudeCodeProxyRoutes.get('/api/claude-code-proxy/:key/v1/models', claudeProxyModels)
|
||||
claudeCodeProxyRoutes.post('/api/claude-code-proxy/:key/v1/messages', claudeProxyMessages)
|
||||
@@ -0,0 +1,7 @@
|
||||
import Router from '@koa/router'
|
||||
import { codexProxyModels, codexProxyResponses } from '../services/codex-proxy'
|
||||
|
||||
export const codexProxyRoutes = new Router()
|
||||
|
||||
codexProxyRoutes.get('/api/codex-proxy/:key/v1/models', codexProxyModels)
|
||||
codexProxyRoutes.post('/api/codex-proxy/:key/v1/responses', codexProxyResponses)
|
||||
@@ -0,0 +1,12 @@
|
||||
import Router from '@koa/router'
|
||||
import * as ctrl from '../controllers/coding-agents'
|
||||
|
||||
export const codingAgentRoutes = new Router()
|
||||
|
||||
codingAgentRoutes.get('/api/coding-agents', ctrl.status)
|
||||
codingAgentRoutes.post('/api/coding-agents/:id/install', ctrl.install)
|
||||
codingAgentRoutes.post('/api/coding-agents/:id/launch/prepare', ctrl.prepareLaunch)
|
||||
codingAgentRoutes.post('/api/coding-agents/:id/launch/native', ctrl.nativeLaunch)
|
||||
codingAgentRoutes.delete('/api/coding-agents/:id', ctrl.remove)
|
||||
codingAgentRoutes.get('/api/coding-agents/:id/config-files/:key', ctrl.readConfigFile)
|
||||
codingAgentRoutes.put('/api/coding-agents/:id/config-files/:key', ctrl.writeConfigFile)
|
||||
@@ -6,6 +6,9 @@ import { webhookRoutes } from './webhook'
|
||||
import { uploadRoutes } from './upload'
|
||||
import { updateRoutes } from './update'
|
||||
import { authPublicRoutes, authProtectedRoutes } from './auth'
|
||||
import { codingAgentRoutes } from './coding-agents'
|
||||
import { claudeCodeProxyRoutes } from './claude-code-proxy'
|
||||
import { codexProxyRoutes } from './codex-proxy'
|
||||
|
||||
// Hermes route modules
|
||||
import { sessionRoutes } from './hermes/sessions'
|
||||
@@ -43,6 +46,8 @@ export function registerRoutes(app: any, authMiddleware: Array<(ctx: Context, ne
|
||||
app.use(healthRoutes.routes())
|
||||
app.use(webhookRoutes.routes())
|
||||
app.use(authPublicRoutes.routes())
|
||||
app.use(claudeCodeProxyRoutes.routes())
|
||||
app.use(codexProxyRoutes.routes())
|
||||
|
||||
// --- Auth middleware: all routes below require authentication ---
|
||||
authMiddleware.forEach((middleware) => app.use(middleware))
|
||||
@@ -52,6 +57,7 @@ export function registerRoutes(app: any, authMiddleware: Array<(ctx: Context, ne
|
||||
app.use(ttsRoutes.routes())
|
||||
app.use(uploadRoutes.routes())
|
||||
app.use(updateRoutes.routes()) // Must be before proxy (proxy catch-all matches everything)
|
||||
app.use(codingAgentRoutes.routes())
|
||||
app.use(sessionRoutes.routes())
|
||||
app.use(profileRoutes.routes())
|
||||
app.use(skillRoutes.routes())
|
||||
|
||||
Reference in New Issue
Block a user