RAG-grounded code generation — retrieves attune context and emits answers with source citations
Failure modes
| Symptom | Cause | Fix | Severity |
|---|---|---|---|
RuntimeWarning: coroutine 'RagCodeGenWorkflow.execute' was never awaited |
execute called without await |
It is a coroutine — await it or use asyncio.run |
high |
error is "query argument is required" |
execute called with an empty/missing query |
Pass a non-empty query |
high |
RuntimeError: ... needs the attune-rag package ... |
attune-rag (a core dependency) is not installed |
pip install attune-rag |
high |
error is "RAG retrieval failed: ..." |
The pipeline raised (corpus I/O, connection, timeout, bad variant) | Check corpus availability / connectivity; retry | medium |
error is "k argument must be an integer ..." |
k wasn't an int (e.g. k="bad") |
Pass an integer k |
low |
error is "unknown model ..." |
model isn't in MODEL_REGISTRY |
Use a registered model id, or omit model |
low |
DeprecationWarning about cwd= |
Passing the deprecated cwd alias |
Use path= instead |
low |
Risk areas
- The async call is easy to get wrong.
executeis a coroutine; forgetting toawaitit is the most common mistake. attune-ragmust be installed. It's a core dependency, not an optional extra — the workflow can't retrieve without it.- Slug vs. feature name. The CLI slug is
rag-code-gen; the feature/help topic israg-grounding.
Diagnosis order
- Confirm you are awaiting:
await workflow.execute(query="..."). - Check
result.success; ifFalse, readresult.error. - If the error mentions attune-rag,
pip install attune-rag. - For a retrieval failure, check corpus availability and connectivity.
- Inspect
result.metadata["citation"]to see what was retrieved.