A documentation agent repeatedly generates API reference pages that omit the throws section for methods that declare checked exceptions. The error has been observed in 15 of the last 20 runs across multiple codebases. Logs confirm the agent reads the source files correctly. What is the most targeted remediation?
Select an answer to reveal the explanation.
Short Explanation and Infographic
If a chef keeps forgetting to add salt to every dish even though they have all the ingredients, you update the recipe card — not hire a new chef or add a salt-injection machine at the end of the line. On the exam: recurring errors caused by missing knowledge should be addressed by refining the agent's instructions and knowledge base, not by adding downstream workarounds.
Full explanation below image
Full Explanation
The pattern here — 15 of 20 runs, multiple codebases, correct source reading — points to a knowledge/instruction gap, not a tool failure or data access problem. The agent reads the source correctly but does not know it should extract and document throws declarations. The appropriate fix (option B) is memory and instruction refinement: add an explicit entry to the agent's knowledge base specifying the throws documentation requirement, and state it as a constraint in the instructions. This addresses the root cause directly and the fix propagates to all future runs.
Option A (post-processing script) is a workaround, not a remediation. It adds complexity to the pipeline, introduces a new potential failure point, and leaves the agent's behavior unchanged — the underlying gap persists. If the script ever fails or is bypassed, the error returns. Downstream workarounds should be a last resort.
Option C (switching models) is incorrect because the problem is a missing requirement in the agent's knowledge/instructions, not a model capability gap. A different model with the same instructions and knowledge base would exhibit the same omission. Model changes are expensive and should be reserved for capability-class problems.
Option D (processing one method at a time) addresses neither the knowledge gap nor the instruction gap. The agent will still omit throws sections for each individual method — just in smaller batches. Granularity is orthogonal to the omission pattern.