Skip to content

feat: optimize context compression algorithm#7052

Open
YYH211 wants to merge 1 commit into
labring:mainfrom
YYH211:codex/context-compression-optimization
Open

feat: optimize context compression algorithm#7052
YYH211 wants to merge 1 commit into
labring:mainfrom
YYH211:codex/context-compression-optimization

Conversation

@YYH211

@YYH211 YYH211 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Optimize request-message, large-content, and tool-response context compression behavior.
  • Remove hard max_tokens truncation from compression LLM calls and rely on prompt budget plus final token validation.
  • Add deterministic over-budget fallbacks and source anchor preservation to improve fidelity and structure.
  • Update compression tests for budget validation, fallback behavior, and benchmark adapter expectations.

Related

Validation

  • pnpm --filter @fastgpt/service test test/core/ai/llm/compress/index.test.ts
  • pro benchmark validation:
    • pnpm typecheck
    • pnpm test

@YYH211 YYH211 changed the title [codex] Optimize context compression algorithm feat: optimize context compression algorithm Jun 3, 2026
@YYH211 YYH211 marked this pull request as ready for review June 3, 2026 13:28
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 14.04% 1158 / 8246
🔵 Statements 14.01% 1213 / 8654
🔵 Functions 12.53% 248 / 1979
🔵 Branches 12.14% 550 / 4527
File CoverageNo changed files found.
Generated in workflow #567 for commit d30b99f by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_d30b99f9d05e775001d4a1ae5cbcc7974ddb8ad9

🕒 Time: 2026-06-03 21:34:35 (UTC+8)

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_d30b99f9d05e775001d4a1ae5cbcc7974ddb8ad9

🕒 Time: 2026-06-03 21:37:41 (UTC+8)

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant