Skip to content

Commit 9f3dec6

Browse files
committed
fix: Add missing await for createDemoContext in API routes
- Fixed TypeScript error in stream-dynamic/route.ts - Fixed negotiate-network/route.ts - Fixed negotiate-ai-to-ai/route.ts - Fixed negotiate-dynamic/route.ts - All createDemoContext calls now properly await Promise resolution This fixes the Cloud Run deployment build error.
1 parent c5c9fe1 commit 9f3dec6

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/app/api/agent/stream-dynamic/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export async function GET(request: Request) {
1919
console.log('[Stream Dynamic] Starting stream for agent', agentId);
2020

2121
// コンテキスト取得
22-
const myContext = createDemoContext(agentId as 1 | 2);
23-
const otherContext = createDemoContext(otherAgentId as 1 | 2);
22+
const myContext = await createDemoContext(agentId as 1 | 2);
23+
const otherContext = await createDemoContext(otherAgentId as 1 | 2);
2424

2525
// プロンプト生成
2626
const prompt = generateRoleDeterminationPrompt(myContext, {

src/app/api/simulation/negotiate-ai-to-ai/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ export async function POST(request: Request) {
3232
context1 = await buildAgentContext(agent1Id, agent1Id);
3333
context2 = await buildAgentContext(agent2Id, agent2Id);
3434
} else {
35-
context1 = createDemoContext(1);
36-
context2 = createDemoContext(2);
35+
context1 = await createDemoContext(1);
36+
context2 = await createDemoContext(2);
3737
}
3838

3939
// 実際のネゴシエーション実行

src/app/api/simulation/negotiate-dynamic/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export async function POST(request: Request) {
4040
} else {
4141
// デモコンテキスト使用
4242
console.log('[API] Using demo contexts...');
43-
context1 = createDemoContext(1);
44-
context2 = createDemoContext(2);
43+
context1 = await createDemoContext(1);
44+
context2 = await createDemoContext(2);
4545
}
4646

4747
// 動的ネゴシエーション実行

src/app/api/simulation/negotiate-network/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export async function POST(request: Request) {
3535
context1 = await buildAgentContext(agent1Id, agent1Id);
3636
context2 = await buildAgentContext(agent2Id, agent2Id);
3737
} else {
38-
context1 = createDemoContext(1);
39-
context2 = createDemoContext(2);
38+
context1 = await createDemoContext(1);
39+
context2 = await createDemoContext(2);
4040
}
4141

4242
// ネットワーク情報を追加

0 commit comments

Comments
 (0)