Skip to content

shell/syntax: bound feature metadata lookahead - #808

Merged
ewhauser merged 2 commits into
mainfrom
ewhauser/bound-feature-metadata-lookahead
Mar 30, 2026
Merged

shell/syntax: bound feature metadata lookahead#808
ewhauser merged 2 commits into
mainfrom
ewhauser/bound-feature-metadata-lookahead

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • bound parameter-expansion metadata lookahead so unsupported-feature errors stop after the bytes needed for classification
  • preserve stable flag/index metadata across chunk boundaries without draining the rest of the reader
  • add a regression proving the parser leaves later reader chunks unread when returning the first LangError

Why

  • the merged parameter-expansion metadata fix solved chunk-boundary instability, but its first implementation used ReadFrom(p.src) and could block on long-lived readers while collecting metadata
  • this follow-up keeps the metadata stable while avoiding whole-stream consumption on the error path

Validation

  • make lint
  • go test ./shell/syntax -run "TestParseLangErrorFeatureMetadata|TestParseLangErrorFeatureMetadataDoesNotDrainReader" -count=1
  • go test ./shell/syntax -count=1

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 229b14e393

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread shell/syntax/parser.go Outdated
@ewhauser
ewhauser merged commit 8bd81a6 into main Mar 30, 2026
16 checks passed
@ewhauser
ewhauser deleted the ewhauser/bound-feature-metadata-lookahead branch March 30, 2026 17:42
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