Skip to content

Fix app-server preview truncation on UTF-8 boundaries#324

Open
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-app-server-utf8-previews
Open

Fix app-server preview truncation on UTF-8 boundaries#324
OnlyYu1996 wants to merge 1 commit into
CortexLM:mainfrom
OnlyYu1996:fix-app-server-utf8-previews

Conversation

@OnlyYu1996
Copy link
Copy Markdown

Fixes PlatformNetwork/bounty-challenge#53262.
Fixes PlatformNetwork/bounty-challenge#53271.

Summary

  • Add a shared app-server preview helper that truncates at the nearest valid UTF-8 character boundary.
  • Use it for filesystem write_file() metadata previews and web fetch_url() response previews.
  • Apply the same helper to web_search() result truncation, which had the same byte-index slicing pattern.

Validation

  • cargo +1.90.0 fmt --package cortex-app-server --check
  • git diff --check
  • Isolated rustc +1.90.0 --edition=2024 --test harness covering 500-byte and 100000-byte UTF-8 boundary cases

Note: targeted cargo test -p cortex-app-server preview::tests -- --nocapture is still blocked before running tests on this Windows/MSVC environment by the existing aws-lc-sys C build failure.

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant