mirror of
https://github.com/usestrix/strix.git
synced 2026-09-28 01:31:44 +00:00
log placeholder substitution in finish_scan partial reports
Greptile review noted the placeholder substitution was silent — adding a warning log when fields are missing makes the substitution visible to operators while keeping the partial-report save behavior intact. The placeholder approach (vs returning a validation error) is intentional — losing the entire scan because the model omitted one section was the original bug from #294, so the trade-off favors saving the report. Co-Authored-By: Octopus <liyuan851277048@icloud.com>
This commit is contained in:
parent
da472ca0d5
commit
7259ffebec
1 changed files with 19 additions and 0 deletions
|
|
@ -100,11 +100,30 @@ def finish_scan(
|
|||
return active_agents_error
|
||||
|
||||
_NOT_PROVIDED = "[Not provided by model]"
|
||||
placeholder_fields = []
|
||||
if not (executive_summary or "").strip():
|
||||
placeholder_fields.append("executive_summary")
|
||||
if not (methodology or "").strip():
|
||||
placeholder_fields.append("methodology")
|
||||
if not (technical_analysis or "").strip():
|
||||
placeholder_fields.append("technical_analysis")
|
||||
if not (recommendations or "").strip():
|
||||
placeholder_fields.append("recommendations")
|
||||
|
||||
executive_summary = (executive_summary or "").strip() or _NOT_PROVIDED
|
||||
methodology = (methodology or "").strip() or _NOT_PROVIDED
|
||||
technical_analysis = (technical_analysis or "").strip() or _NOT_PROVIDED
|
||||
recommendations = (recommendations or "").strip() or _NOT_PROVIDED
|
||||
|
||||
if placeholder_fields:
|
||||
import logging
|
||||
|
||||
logging.warning(
|
||||
"finish_scan: model omitted required field(s) %s; "
|
||||
"saving partial report with placeholder text",
|
||||
placeholder_fields,
|
||||
)
|
||||
|
||||
try:
|
||||
from strix.telemetry.tracer import get_global_tracer
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue