Skip to content

Commit 44affdf

Browse files
fix: strip item IDs from Codex requests to fix multi-turn conversations
1 parent 5d8c61f commit 44affdf

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • packages/browseros-agent/apps/server/src/lib/clients/oauth

packages/browseros-agent/apps/server/src/lib/clients/oauth/codex-fetch.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ export function createCodexFetch(accountId?: string) {
4444
if (!json.instructions) {
4545
json.instructions = 'You are a helpful assistant.'
4646
}
47+
// Strip item IDs — Codex doesn't persist items when store=false,
48+
// so referencing them in subsequent turns causes "item not found" errors
49+
if (Array.isArray(json.input)) {
50+
for (const item of json.input) {
51+
if ('id' in item) {
52+
delete item.id
53+
}
54+
}
55+
}
4756
body = JSON.stringify(json)
4857
} catch (err) {
4958
logger.warn('Failed to inject Codex-required fields into request body', {

0 commit comments

Comments
 (0)