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
If the agent keeps forgetting throws sections even though it reads the source correctly, you update its recipe card: put the requirement in its knowledge base and instructions. That fixes the missing-knowledge root cause instead of bolting on downstream workarounds.
Full Explanation
The pattern here — 15 of the last 20 runs, multiple codebases, and confirmed correct source reading — points to a knowledge or 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 most targeted remediation 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 agent's instructions. This addresses the root cause directly, and the fix propagates to all future runs. 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.
The post-processing-script approach 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.
The model-switching approach is incorrect because the problem is a missing requirement in the agent's knowledge or 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.
The one-method-at-a-time approach 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.