Skip to content

fix(core): create temp dir before saving truncated shell output - #3875

Merged
tanzhenxin merged 1 commit into
QwenLM:mainfrom
kkhomej33-netizen:fix/acp-truncated-output-temp-dir
May 7, 2026
Merged

fix(core): create temp dir before saving truncated shell output#3875
tanzhenxin merged 1 commit into
QwenLM:mainfrom
kkhomej33-netizen:fix/acp-truncated-output-temp-dir

Conversation

@kkhomej33-netizen

Copy link
Copy Markdown
Contributor

Summary

  • What changed: The shell output truncation path now ensures project runtime temp storage exists before saving the full output file.
  • Why it changed: Fresh ACP sessions can encounter large shell output before any project temp storage has been initialized, which prevents the full-output file from being written and leaves oversized output untruncated.
  • Reviewer focus: Confirm the fix preserves the existing behavior that truncation only replaces model-facing content when the full output is successfully saved.

Validation

  • Commands run:
    npx vitest run src/utils/truncation.test.ts from packages/core
    npm run build
    npm run typecheck
  • Prompts / inputs used: Unit test coverage exercises oversized output that needs to be saved before truncation can report a full-output path.
  • Expected result: Oversized output creates project temp storage before saving the complete output file, then returns truncated output with the saved file path.
  • Observed result: The focused truncation test passed, and repository build and typecheck completed successfully.
  • Quickest reviewer verification path: Run npx vitest run src/utils/truncation.test.ts from packages/core.
  • Evidence: Local command output reported 10 passing tests for src/utils/truncation.test.ts. Build and typecheck exited successfully.

Scope / Risk

  • Main risk or tradeoff: Low. The change only creates the already-selected project temp directory immediately before writing the full saved output.
  • Not covered / not validated: End-to-end ACP reproduction was not run locally.
  • Breaking changes / migration notes: None.

Testing Matrix

macOS Windows Linux
npm run tested not tested not tested
npx tested not tested not tested
Docker not tested not tested not tested
Podman not tested N/A N/A
Seatbelt not tested N/A N/A

Testing matrix notes:

  • Validation was local on macOS only.

Linked Issues / Bugs

Fixes #3874

@wenshao wenshao left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found. LGTM! ✅ — gpt-5.5 via Qwen Code /review

@tanzhenxin tanzhenxin added the type/bug Something isn't working as expected label May 7, 2026

@tanzhenxin tanzhenxin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean one-line fix for #3874: mkdir { recursive: true } before writing the saved-output file, so fresh ACP sessions that hit oversized shell output before any project temp storage exists no longer end up with an untruncated payload. Tests cover both the below-threshold (mkdir not called) and truncating (mkdir called) paths, and the existing try/catch already absorbs mkdir failures via the error field — no new failure mode introduced.

Verdict

APPROVE — minimal, targeted, with appropriate test coverage.

@tanzhenxin
tanzhenxin merged commit 49f8828 into QwenLM:main May 7, 2026
13 checks passed
TaimoorSiddiquiOfficial pushed a commit to TaimoorSiddiquiOfficial/HopCode that referenced this pull request May 7, 2026
xaelistic pushed a commit to xaelistic/qwen-code that referenced this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shell output truncation can miss fresh project temp dirs

3 participants