Pull Request Code and Change Review Assistance: Multi-turn Dialogue and Prompt Engineering

This category's data primarily originates from code repositories, CI pipelines, linked Issue links, and contributor submission records. Daily

What Data for This Category Looks Like

This category's data primarily originates from code repositories, CI pipelines, linked Issue links, and contributor submission records. Daily circulated documents include PR descriptions, code review comments, CI execution results, and merge records. Data update frequencies are typically daily or weekly. Core fields include PR numbers, changed file lists, code diff snippets, CI pass rates, review comment entries, and merge status indicators.

What Constraints These Characteristics Place on Multi-turn Dialogue and Prompt Engineering

Data for this category comes from multiple dispersed sources such as code repositories and CI pipelines, with an update frequency of daily or weekly. Therefore, multi-turn dialogue must splice heterogeneous context step-by-step according to the interaction rounds of messages to avoid loading redundant data all at once. Documents contain content in different formats such as code diffs and CI results, so prompts must clearly distinguish logical branches for code change verification and automated result checking. Linked Issues and merge records must be passed as fixed context parameters via variables to ensure each dialogue round matches the corresponding PR's linked information, while limiting the number of historical dialogue rounds to adapt to the data update rhythm. FastGPT v4.17.0 supports precise splicing configuration for this type of context.

How to Configure the Settings

Configuration ItemRecommended ApproachRationale
chatIdBind to the unique PR numberEnsure each dialogue round is linked to the context of a fixed PR, avoiding session confusion
messagesRetain the most recent 3 dialogue rounds, with a maximum length of 8000 tokensAdapt to the daily/weekly update rhythm of PR data, avoiding loading expired or redundant review history
variablesPass PR number, changed file list, and CI statusQuickly inject core PR metadata, reducing the overhead of repeated repository information retrieval
Maximum context roundsCalibrate based on actual testingAdapt to the context length of different scale PRs, avoiding exceeding the model's processing limit
Prompt templateCustomized for PR review scenariosMatch the heterogeneous data verification logic for code diffs and CI results

Three Common Misconfigurations

  • A 400 invalid image error is returned in dialogue, with logs showing abnormal image parameters. Non-text resources linked in PRs are not filtered, and image links are directly passed to messages, causing the model interface verification to fail.
  • After connecting to an external dialogue interface, only the first round of dialogue can be triggered, with no response in subsequent interactions. chatId is not correctly bound to the external session identifier, causing each dialogue round to generate a new session context.
  • After configuring a local model, it automatically switches to a public model and cannot be called normally. Model calling parameters are not locked via variables, causing the platform to load the preset model by default.

How to Verify Successful Configuration

  • Initiate the first round of PR review dialogue, check whether chatId matches the current PR number to ensure correct session binding.
  • Enter questions related to code changes, check whether the returned content includes the passed variables metadata to verify that context injection takes effect.
  • Test multi-turn interaction, confirm that the number of messages historical rounds does not exceed the preset limit, with no redundant old data interfering.
  • Trigger a test request containing image links, confirm that non-text resources are filtered, with no interface errors.

The values provided are common starting points and should be measured 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.