Skip to content

fix: replaced the hardcoded value with docstring#2

Open
httpsVishu wants to merge 1 commit intowunderlabs-dev:mainfrom
httpsVishu:limit
Open

fix: replaced the hardcoded value with docstring#2
httpsVishu wants to merge 1 commit intowunderlabs-dev:mainfrom
httpsVishu:limit

Conversation

@httpsVishu
Copy link

Description

while exploring the codebase, i found in src/tools/share.ts, in the error message, there is a hardcoded value for 50 MB

throw new Error(
  `Session too large: ${(sizeBytes / 1024 / 1024).toFixed(1)}MB exceeds 50MB limit`
);

actual limit is defined using the constant MAX_SESSION_SIZE_BYTES in constants.ts, if this constant is changed in future, the error message would become inconsistent. so it is better to be corrected now.

what i added:

const limitMB = MAX_SESSION_SIZE_BYTES /(1024*1024);

throw new Error(
  `Session too large: ${(sizeBytes / 1024 / 1024).toFixed(1)}MB exceeds ${limitMB}MB limit`
);

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring

Testing

testing was done locally by running the typescript type check and built process to ensure the change compiles correctly
commands used:
npm run type-check and npm run build
no errors were encountered

Checklist

  • I've tested my changes locally
  • I've updated documentation if needed
  • My code follows the project style

@vtemian
Copy link
Contributor

vtemian commented Mar 10, 2026

@httpsVishu thank you!
Can you palso attach the claudebin session?

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.

2 participants