Skip to content

fix(context): fall back to path basename for unnamed bootstrap files#829

Open
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-48021-fix-bootstrap-undefined-label
Open

fix(context): fall back to path basename for unnamed bootstrap files#829
BingqingLyu wants to merge 1 commit into
mainfrom
fork-pr-48021-fix-bootstrap-undefined-label

Conversation

@BingqingLyu

@BingqingLyu BingqingLyu commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Fixes openclaw#47941

Hook-injected virtual bootstrap files may omit the name field. buildBootstrapInjectionStats now falls back to path.basename(file.path) (then a "(virtual file)" placeholder) so /context breakdown never renders a literal undefined label.

Changes

  • bootstrap-budget.ts: derive name from file.name || basename(path) || "(virtual file)"
  • bootstrap-budget.test.ts: add test covering missing/empty name with a valid path

…missing

Hook-injected virtual bootstrap files may omit the name field.
buildBootstrapInjectionStats now falls back to basename(path) so
the context breakdown never renders a literal "undefined" label.

Closes openclaw#47941
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.

Context breakdown can label virtual bootstrap files as 'undefined' instead of falling back to path/basename

2 participants