[WIP] Fix failing GitHub Actions job JS Tests (shard 4/4)#32840
Merged
Conversation
…ndler Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors safe-output large-content handling and applies it to create_issue so oversized issue fields are written to files instead of directly appended.
Changes:
- Extracted large string detection/offloading into
maybeHandleLargeContent. - Reused the helper in the default safe-output handler.
- Added large-content handling to
createIssueHandler.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/safe_outputs_handlers.cjs |
Refactors large-content handling and applies it to create issue safe outputs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
actions/setup/js/safe_outputs_handlers.cjs:52
- The helper stops after offloading the first oversized string field, so any additional >16k-token string fields remain in the NDJSON entry that gets appended. For tools like
create_issuewith bothtitleandbody(or dynamic tools with multiple large string inputs), this can still write an oversized safe-output record and reproduce the failure this handler is meant to avoid. The scan should continue and replace every oversized string field before appending.
for (const [key, value] of Object.entries(entry)) {
if (typeof value === "string") {
const tokens = estimateTokens(value);
if (tokens > TOKEN_THRESHOLD) {
largeContent = value;
largeFieldName = key;
server.debug(`Field '${key}' has ${tokens} tokens (exceeds ${TOKEN_THRESHOLD})`);
break;
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
+1033
to
+1034
| const largeContentResponse = maybeHandleLargeContent(entry); | ||
| if (largeContentResponse) return largeContentResponse; |
Collaborator
|
@copilot review all comments |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Addressed. I reviewed the thread and applied the requested follow-up so duplicate |
Contributor
|
WIP: tests failing on JS shard 4/4 — please review.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
pr-sous-chef: requested branch update (run: https://github.com/github/gh-aw/actions/runs/25996524238)