Skip to content

上下文压缩问题 #842

Closed
Closed

Description

@CL545740896

上下文压缩的性能可以优化下吗?

Activity

  1. harryfan1985 commented on May 23, 2026

    @harryfan1985
    Contributor

    Synced update from PR #845: #845

    This PR includes context-compression changes relevant to this issue:

    • Replaced the prior sequential multi-chunk compression flow with a map/reduce-style flow.
    • Added bounded map-phase concurrency through map_reduce_max_parallel_requests (default: 4), avoiding unbounded parallel model requests for very large sessions.
    • Added reduce-stage token-budget protection. If all segment summaries do not fit in one reduce prompt, compression now performs bounded batched reduce passes.
    • If reduce still cannot fit safely, the compressor returns through the existing structured local fallback path instead of sending an oversized request to the model.

    Follow-up hardening was added in commit 907e2d23:

    • fix(core): harden prompt caching compression

    Verification passed:

    • cargo check -p bitfun-core
    • cargo test -p bitfun-core compression -- --nocapture
    • cargo test -p bitfun-core agentic::agents::prompt_builder -- --nocapture
    • cargo check --workspace
    • cargo test --workspace
  2. GCWing commented on May 28, 2026

    @GCWing
    Collaborator

    已有部分优化,可以等新版本尝试(0.2.9,预计5.29发布),Issue暂时关闭,后续版本有问题可以继续打开讨论

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions