@@ -2438,17 +2438,15 @@ def _bind(val: Any) -> str:
24382438 where .append (f"status = { _bind (status .strip ())} " )
24392439 if q and q .strip ():
24402440 like = f"%{ q .strip ()} %"
2441- b1 , b2 , b3 , b4 , b5 = (
2442- _bind (like ),
2441+ b1 , b2 , b3 , b4 = (
24432442 _bind (like ),
24442443 _bind (like ),
24452444 _bind (like ),
24462445 _bind (like ),
24472446 )
24482447 where .append (
24492448 f"(id LIKE { b1 } OR user_id LIKE { b2 } OR prompt LIKE { b3 } OR "
2450- f"coalesce(json_extract(meta_json, '$.trace_id'), '') LIKE { b4 } OR "
2451- f"coalesce(json_extract(meta_json, '$.decision_log.trace_id'), '') LIKE { b5 } )"
2449+ f"coalesce(json_extract(meta_json, '$.decision_log.trace_id'), '') LIKE { b4 } )"
24522450 )
24532451 route_filter = (route or "" ).strip ().lower ()
24542452 if route_filter :
@@ -2477,24 +2475,20 @@ def _bind(val: Any) -> str:
24772475 f"""
24782476 SELECT
24792477 id, user_id, scene, status, prompt, error_message, created_at, updated_at,
2480- json_extract(meta_json, '$.trace_id') AS trace_id,
24812478 json_extract(meta_json, '$.control') AS control,
24822479 json_extract(meta_json, '$.flow_id') AS flow_id,
2480+ json_extract(meta_json, '$.flow_version') AS flow_version,
24832481 json_extract(meta_json, '$.decision_log.trace_id') AS dl_trace,
24842482 json_extract(meta_json, '$.decision_log.route') AS dl_route,
24852483 json_extract(meta_json, '$.decision_log.intent') AS dl_intent,
2486- json_extract(meta_json, '$.execution_log.trace_id') AS el_trace,
2487- json_extract(meta_json, '$.execution_log.intent') AS el_intent,
2488- json_extract(meta_json, '$.execution_log.flow_id') AS el_flow,
24892484 json_extract(meta_json, '$.execution_log.ops_count') AS ops_count,
24902485 json_extract(meta_json, '$.execution_log.total_tokens') AS total_tokens,
24912486 json_extract(meta_json, '$.execution_log.total_duration_ms') AS total_duration_ms,
24922487 json_extract(meta_json, '$.execution_log.painted') AS painted,
24932488 json_extract(meta_json, '$.execution_log.task_tier') AS task_tier,
24942489 json_extract(meta_json, '$.execution_log.vision_used') AS vision_used,
24952490 json_extract(meta_json, '$.execution_log.model') AS model,
2496- json_extract(meta_json, '$.execution_log.skills_loaded') AS el_skills,
2497- json_extract(meta_json, '$.decision_log.skills_loaded') AS dl_skills
2491+ json_extract(meta_json, '$.execution_log.skills_loaded') AS el_skills
24982492 FROM design_task
24992493 WHERE { sql_where }
25002494 ORDER BY created_at DESC
0 commit comments