What the data for this category looks like
Data for this category primarily comes from Git repositories, CI pipelines, static scan reports, and defect libraries. Daily associated documents include merge requests, code review comments, commit logs, and branch strategy descriptions. Data triggers updates daily or after each code commit. Fields include change scope, commit hash, reviewer identifiers, defect association numbers, and more. There is no fixed statistical caliber; data is generated in real time alongside development activities.
What constraints do these characteristics impose on the context and token workflow
Data for this category is linked to outputs from multiple development workflows. The context for a single change may include multiple segments of committed code, past review comments, and linked defect details. Total context length varies widely. The high-frequency update feature requires real-time synchronization of the latest commits and review records. This avoids review bias caused by stale data. Mixed multi-source data consumes significant token quota. Without proper limits, this may exceed the LLM's context upper limit, impairing change impact assessment and review communication efficiency.
How to configure the settings
| Configuration Item | Recommended Approach | Rationale |
|---|---|---|
maxContext | First 10–15 merge request contexts | The core context for this category is recent merge requests and review records. Excess old data consumes token quota and affects semantic judgment of current changes. |
quoteMaxToken | 8000–12000 token | Covers the total length of code snippets, review comments, and linked defects for a single change, compatible with base token limits of most LLMs. |
| Maximum context refresh interval | Refresh after each commit | Matches the update frequency of this category's data (daily or per commit) to ensure context always syncs latest development actions. |
| Context recall count | First 5 active review records | Prevents redundant data from interfering with review judgment of current changes, focusing on the business scope of the current review. |
| Calibrate based on actual testing | Adjust based on average merge request length of the team | Adapts to code review context needs of teams of different sizes. |
Three common configuration errors
- Setting
maxContextto more than 20 entries causes context pollution. Review context for this category includes multiple independent merge request changes. Excess old data mixes into the semantic scope of the current review, leading the LLM to confuse business logic of different changes. - The context count shown in conversation details does not match the set value. For example, setting 30 entries only displays 2. This occurs because the context refresh interval does not match the update rhythm of this category's data. The interval is too long, failing to sync latest review records and commit content.
- The LLM prompts that the context token count exceeds limits. This happens because the
quoteMaxTokenquota is not restricted. The total length of code snippets and review comments in a single input exceeds the token limit supported by the LLM.
How to confirm the configuration is valid
- In the FastGPT v4.17.0 environment, initiate a simulated merge request review. Check if the context count shown in conversation details matches the set value of
maxContext. - Submit a change containing multiple code snippets and multiple review comments. Verify that the LLM can accurately associate the business semantics of the current change without interference from irrelevant old context.
- Submit a code change of unusually long length. Check that the LLM returns a reasonable context processing result without token limit exceeded errors.
- Trigger a new code commit. Verify that the context automatically refreshes to the latest review records and commit content.
The values provided are common starting points and should be evaluated against the reader's own samples.
Question material comes from public community discussions. Configuration values are common starting points and should be measured against your own samples. Verified on 2026-10-19.