Skip to content

fix(cli): avoid exit-time history deep clones#4717

Open
he-yufeng wants to merge 1 commit into
QwenLM:mainfrom
he-yufeng:fix/avoid-exit-history-clones
Open

fix(cli): avoid exit-time history deep clones#4717
he-yufeng wants to merge 1 commit into
QwenLM:mainfrom
he-yufeng:fix/avoid-exit-history-clones

Conversation

@he-yufeng
Copy link
Copy Markdown
Contributor

Summary

  • replace remaining exit-adjacent getHistory() calls in slash commands and ACP snapshot capture with getHistoryShallow()
  • keep restoreHistory() defensive cloning unchanged while avoiding a second deep clone during snapshot capture
  • update copy, arena, and ACP session tests to exercise the shallow history path

Fixes #4698.

To verify

  • npm run test --workspace=packages/cli -- src/ui/commands/copyCommand.test.ts src/ui/commands/arenaCommand.test.ts src/ui/commands/arenaCommand.agentComplete.test.ts src/acp-integration/session/Session.test.ts
  • npx eslint packages/cli/src/ui/commands/copyCommand.ts packages/cli/src/ui/commands/summaryCommand.ts packages/cli/src/ui/commands/arenaCommand.ts packages/cli/src/acp-integration/session/Session.ts packages/cli/src/ui/commands/copyCommand.test.ts packages/cli/src/ui/commands/arenaCommand.agentComplete.test.ts packages/cli/src/acp-integration/session/Session.test.ts
  • npm run typecheck --workspace=packages/cli
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OOM during /quit persists after #4644 — remaining getHistory() sites + unexplained retainer

1 participant