Skip to content

Fix fuzz test length check for mention wrapping overhead#6660

Merged
pelikhan merged 3 commits intomainfrom
copilot/investigate-fuzzed-test-failure
Dec 16, 2025
Merged

Fix fuzz test length check for mention wrapping overhead#6660
pelikhan merged 3 commits intomainfrom
copilot/investigate-fuzzed-test-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 16, 2025

The FuzzMentionsFiltering test was failing because its length check didn't account for mention neutralization overhead. When @user is sanitized, it becomes `@user`, adding 2 characters per mention.

Changes

  • Updated length check formula from len(text) + len(text)/2 (1.5x) to len(text) * 7/2 (3.5x)
  • Formula now accounts for: base length (1x) + general expansion (0.5x) + worst-case backtick wrapping (2x)
  • Aligns with existing FuzzSanitizeIncomingText approach for consistency

Before:

if len(result.Sanitized) > len(text)+len(text)/2 {
    t.Errorf("Sanitized result is unexpectedly longer than input")
}

After:

expectedMaxLen := len(text) * 7 / 2
if len(result.Sanitized) > expectedMaxLen {
    t.Errorf("Sanitized result is unexpectedly longer than expected (input: %d, result: %d, expected max: %d)",
        len(text), len(result.Sanitized), expectedMaxLen)
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login 5054-28936/test-3690393186 GO111MODULE 5054-28936/test-3690393186/.gitattributes GOINSECURE GOMOD GOMODCACHE go ortc�� it/ref/tags/v5 stmain.go ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet GOINSECURE GOMOD GOMODCACHE ache/go/1.25.0/x64/pkg/tool/linu--log (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login -json GO111MODULE ps GOINSECURE GOMOD GOMODCACHE ps fere�� ference.git GO111MODULE /opt/hostedtoolcache/go/1.25.0/x64/bin/go GOINSECURE GOMOD GOMODCACHE go (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login it/ref/tags/v5 GO111MODULE .cfg GOINSECURE GOMOD GOMODCACHE SKxUVknvXufI3/2ZUc9vejZHNutLcI0TfW/k1CYBPiUyEBsv--jq env ry=1 GO111MODULE 4218661/b370/_pkg_.a GOINSECURE 8ee817ca88b8f643-rf GOMODCACHE go (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Investigate fuzzed test failure. https://github.com/githubnext/gh-aw/actions/runs/20278163482/job/58232895092


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 16, 2025 18:48
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate fuzzed test failure in GitHub Actions Fix fuzz test length check for mention wrapping overhead Dec 16, 2025
Copilot AI requested a review from pelikhan December 16, 2025 18:59
@pelikhan pelikhan marked this pull request as ready for review December 16, 2025 18:59
@pelikhan pelikhan merged commit 4ee1cce into main Dec 16, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/investigate-fuzzed-test-failure branch December 16, 2025 18:59
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