core-agent-ide/codex-cli/src/utils
moppywhip 9b0ccf9aeb
fix: duplicate messages in quiet mode (#680)
Addressing #600 and #664 (partially)

## Bug
Codex was staging duplicate items in output running when the same
response item appeared in both the streaming events. Specifically:

1. Items would be staged once when received as a
`response.output_item.done` event
2. The same items would be staged again when included in the final
`response.completed` payload

This duplication would result in each message being sent several times
in the quiet mode output.

## Changes
- Added a Set (`alreadyStagedItemIds`) to track items that have already
been staged
- Modified the `stageItem` function to check if an item's ID is already
in this set before staging it
- Added a regression test (`agent-dedupe-items.test.ts`) that verifies
items with the same ID are only staged once

## Testing
Like other tests, the included test creates a mock OpenAI stream that
emits the same message twice (once as an incremental event and once in
the final response) and verifies the item is only passed to `onItem`
once.
2025-04-26 09:14:50 -07:00
..
agent fix: duplicate messages in quiet mode (#680) 2025-04-26 09:14:50 -07:00
logger chore: improve storage/ implementation; use log(...) consistently (#473) 2025-04-21 09:51:34 -04:00
singlepass refactor: improve performance of renderFilesToXml using Array.join (#127) 2025-04-16 16:14:57 -07:00
storage chore: improve storage/ implementation; use log(...) consistently (#473) 2025-04-21 09:51:34 -04:00
approximate-tokens-used.ts fix(cli): ensure /clear resets context and exclude system messages from approximateTokenUsed count (#443) 2025-04-20 08:52:14 -07:00
auto-approval-mode.js Initial commit 2025-04-16 12:56:08 -04:00
auto-approval-mode.ts Initial commit 2025-04-16 12:56:08 -04:00
bug-report.ts fix: /bug report command, thinking indicator (#381) 2025-04-18 18:13:34 -07:00
check-in-git.ts Initial commit 2025-04-16 12:56:08 -04:00
check-updates.ts refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446) 2025-04-21 00:00:20 -07:00
compact-summary.ts fix: inconsistent usage of base URL and API key (#507) 2025-04-22 10:51:26 -04:00
config.ts feat: Add support for OpenAI-Organization and OpenAI-Project headers (#626) 2025-04-25 09:52:42 -07:00
extract-applied-patches.ts feat: /diff command to view git diff (#426) 2025-04-19 16:23:27 -07:00
file-system-suggestions.ts feat: tab completions for file paths (#279) 2025-04-20 22:34:27 -07:00
get-diff.ts feat: /diff command to view git diff (#426) 2025-04-19 16:23:27 -07:00
input-utils.ts Add fallback text for missing images (#397) 2025-04-18 22:55:24 -07:00
model-info.ts feat: add openai model info configuration (#551) 2025-04-22 17:31:25 -04:00
model-utils.ts feat: Add support for OpenAI-Organization and OpenAI-Project headers (#626) 2025-04-25 09:52:42 -07:00
package-manager-detector.ts refactor(updates): fetch version from registry instead of npm CLI to support multiple managers (#446) 2025-04-21 00:00:20 -07:00
parsers.ts fix: agent loop for disable response storage (#543) 2025-04-22 13:49:10 -07:00
providers.ts feat: support multiple providers via Responses-Completion transformation (#247) 2025-04-20 20:59:34 -07:00
responses.ts bug: non-openai mode - don't default temp and top_p (#572) 2025-04-23 01:07:40 -04:00
session.ts bump(version): 0.1.2504251709 (#660) 2025-04-25 17:15:40 -07:00
short-path.ts Initial commit 2025-04-16 12:56:08 -04:00
slash-commands.ts feat(bug-report): print bug report URL in terminal instead of opening browser (#510) (#528) 2025-04-24 17:00:14 -07:00
terminal-chat-utils.ts chore: consolidate model utils and drive-by cleanups (#476) 2025-04-21 12:33:57 -04:00
terminal.ts fix: /clear now clears terminal screen and resets context left indicator (#425) 2025-04-21 12:39:46 -04:00