Skip to content

fix: bound loaded profile context - #110

Open
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/bound-loaded-profile-context
Open

fix: bound loaded profile context#110
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/bound-loaded-profile-context

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • bound persisted user profiles and server memory when loading them into Claude context, preserving the configured 2,000/10,000-code-unit limits for oversized existing files
  • stop before a UTF-16 surrogate pair when a legacy file crosses the read boundary
  • cover exact ASCII caps and Unicode-safe reads for both storage paths

Verification

  • RED on untouched upstream/main: the focused test loaded all 2,500 profile characters instead of 2,000
  • npm run build — passed
  • node --test tests/profileStorageBounds.test.mjs — passed
  • npm test — passed (66 tests)
  • direct node-pty import — passed
  • git diff --check — passed

Distinctness

  • PR fix: preserve profile Unicode boundaries #83 protects new profile and server-memory writes at their Unicode boundaries; this PR independently bounds oversized persisted files when they are read, while preserving the same Unicode invariant.

Risk

  • Low: files are not rewritten, shorter values are unchanged, and a cap that falls inside an astral character stops one UTF-16 code unit earlier rather than returning an invalid half-character.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

@vycdev2
vycdev2 force-pushed the fix/bound-loaded-profile-context branch from 4899093 to fb3d2a0 Compare August 10, 2026 01:45
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