VerifierAgent generates N independent verification questions about the draft’s claims, answers each in isolation, and rewrites the response when discrepancies are detected. Emits the signal that activates Reflexion on hallucinations.
Chain-of-Verification (Dhuliawala et al., 2023) is the canonical technique for reducing hallucination in LLM output. The flow: produce answer → generate verification questions about its claims → answer each question independently (without seeing the original answer) → reconcile discrepancies.ChatCLI implements via VerifierAgent (pure reasoning, zero tools) + VerifyHook (PostHook in the pipeline). When a discrepancy is detected, the verified_with_discrepancy flag is recorded in result.Metadata, activating Reflexion downstream.
CoVe is opt-in. With CHATCLI_QUALITY_VERIFY_ENABLED=false (default), zero overhead. When enabled, it adds +1 LLM call per use point with high effort (default effort="high").
The model receives TASK + DRAFT and emits five blocks:
<status>verified-clean OR verified-with-corrections</status><questions>- Q1: specific verifiable claim 1- Q2: specific verifiable claim 2- Q3: specific verifiable claim 3</questions><answers>- A1: independent answer to Q1 (without looking at DRAFT)- A2: independent answer to Q2- A3: independent answer to Q3</answers><discrepancies>- description of discrepancy, OR "none"</discrepancies><final>…answer ready to deliver to user (verbatim of DRAFT if verified-clean,or rewritten if verified-with-corrections)…</final>
The protocol instructs the model to answer each Q<n>without referring to the DRAFT. This is the heart of CoVe — if independent answers contradict the draft, there’s a suspect claim.
Models that just parrot the draft in the answers defeat the pattern. The system prompt emphasizes this explicitly; use models capable of “self-distance” (Claude Sonnet, GPT-4+).
# Use a stronger model just for verifyexport CHATCLI_AGENT_VERIFIER_MODEL="claude-opus-4-7"export CHATCLI_AGENT_VERIFIER_EFFORT="max"# Or more questions for critical workflowsexport CHATCLI_QUALITY_VERIFY_NUM_QUESTIONS=5
Go’s http.Client has a DefaultTimeout field you can set globally. Just do http.DefaultClient.DefaultTimeout = 30 * time.Second in the program’s init.
Error:DefaultTimeoutdoesn’t exist. It’s Timeout (and there’s no “DefaultTimeout” in stdlib).
- Q1: Does the `net/http.Client` struct in Go have a field called `DefaultTimeout`?- Q2: What is the correct field name for setting a timeout on `http.Client`?- Q3: Is `http.DefaultClient` mutable and reassignable?
- A1: No, `net/http.Client` has a `Timeout` field (type `time.Duration`), not `DefaultTimeout`.- A2: The correct field is `Timeout`, used as `client.Timeout = 30 * time.Second`.- A3: `http.DefaultClient` is a pointer to a pre-allocated Client; modifying its fields is legal but has process-wide side effects.
- Draft refers to `DefaultTimeout` field, which does not exist. Correct field is `Timeout`.
Status: verified-with-corrections
Go’s http.Client has a Timeout field (not DefaultTimeout). To apply globally you can do:
http.DefaultClient.Timeout = 30 * time.Second
But note: DefaultClient is shared across the whole process — global modifications affect every caller of http.Get, http.Post, etc. For isolation, instantiate your own &http.Client{Timeout: ...}.
Flag recorded as result.Metadata["verified_with_discrepancy"]=true. If Reflexion is on (default), a lesson is generated in background:
LESSON: Citing Go stdlib API fieldsMISTAKE: Invented "DefaultTimeout" field on http.ClientCORRECTION: Verify symbol exists via go doc or grep before citingTRIGGER: hallucination
Refine improves stylistic quality first; Verify checks factual accuracy over the already-refined output. Reverse order (verify → refine) would work, but a refine rewrite could introduce unverified claims.
If you only enable one of them, prefer Verify for factual workflows (technical docs, API-heavy code) and Refine for stylistic workflows (summaries, reports).
CoVe with weak models generates shallow questions or “verifications” that just paraphrase the draft. Use Sonnet, Opus, or GPT-4+ as CHATCLI_AGENT_VERIFIER_MODEL.