Skip to content

fix: bound error log payloads and isolate test homes - #406

Open
msamoilenko wants to merge 1 commit into
lessweb:mainfrom
msamoilenko:pr/log-hygiene
Open

msamoilenko wants to merge 1 commit into
lessweb:mainfrom
msamoilenko:pr/log-hygiene

Conversation

@msamoilenko

Copy link
Copy Markdown

Problem

The API error log wrote full request payloads and kept only 20 entries. A session could produce multi-megabyte lines, tests wrote to the real ~/.deepcode/logs/error.log, and raw sk- keys were not masked.

Change

  • Mask Authorization, api_key, secret, token, and raw sk-... values.
  • Truncate every string value to 500 chars; cap each entry at 32k chars; retain the last 50 entries.
  • Run the core, CLI, and VS Code test suites with a temporary HOME and clean it up.
  • Add a regression test covering masking, truncation, the entry cap, and retention.

Verification

  • npm run check passes.
  • Core: 650 passing.
  • CLI: 633 passing.
  • VS Code: 88 passing.
  • The real ~/.deepcode/logs/error.log was unchanged before and after the suites.

Mask raw sk- keys, truncate every logged string, cap entries at 32k chars, and retain the last 50 entries. Run each package test suite with a temporary HOME so tests never write to the real ~/.deepcode.
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.

1 participant