Spaces:
Sleeping
Sleeping
Commit ·
101d812
1
Parent(s): eac318a
Enhanced validator payload diagnostic logging - capture action schema and fixed_config details
Browse files
server/config_debug_environment.py
CHANGED
|
@@ -56,13 +56,60 @@ class ConfigDebugEnvironment(Environment):
|
|
| 56 |
task_id = self._current_task_id()
|
| 57 |
task = get_task(task_id)
|
| 58 |
|
| 59 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
print(
|
| 61 |
f"[VALIDATOR SUBMITTED] task={task_id} "
|
| 62 |
-
f"fixed_config length={len(action.fixed_config)} chars",
|
| 63 |
flush=True
|
| 64 |
)
|
| 65 |
-
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
# Run the grader (returns float for validator compatibility)
|
| 68 |
grader_result = task.grader(action.fixed_config)
|
|
|
|
| 56 |
task_id = self._current_task_id()
|
| 57 |
task = get_task(task_id)
|
| 58 |
|
| 59 |
+
# ========== CRITICAL DIAGNOSTIC: Log everything about the validator submission ==========
|
| 60 |
+
print("\n" + "="*80, flush=True)
|
| 61 |
+
print("[VALIDATOR STEP PAYLOAD RECEIVED]", flush=True)
|
| 62 |
+
print(f" Action Type: {type(action).__name__}", flush=True)
|
| 63 |
+
print(f" Action class: {action.__class__.__module__}.{action.__class__.__name__}", flush=True)
|
| 64 |
+
print(f" Task ID: {task_id}", flush=True)
|
| 65 |
+
|
| 66 |
+
# Log fixed_config in detail
|
| 67 |
+
fc = action.fixed_config
|
| 68 |
+
print(f" fixed_config type: {type(fc).__name__}", flush=True)
|
| 69 |
+
print(f" fixed_config is None: {fc is None}", flush=True)
|
| 70 |
+
print(f" fixed_config length: {len(fc) if fc else 0} chars", flush=True)
|
| 71 |
+
|
| 72 |
+
if fc is None:
|
| 73 |
+
print(" ⚠️ WARNING: fixed_config is None!", flush=True)
|
| 74 |
+
fc_display = "(NONE)"
|
| 75 |
+
elif fc == "":
|
| 76 |
+
print(" ⚠️ WARNING: fixed_config is empty string!", flush=True)
|
| 77 |
+
fc_display = "(EMPTY STRING)"
|
| 78 |
+
else:
|
| 79 |
+
fc_display = repr(fc[:300]) # First 300 chars
|
| 80 |
+
print(f" fixed_config (first 300 chars): {fc_display}", flush=True)
|
| 81 |
+
|
| 82 |
+
# Try to detect format
|
| 83 |
+
if fc and len(fc) > 0:
|
| 84 |
+
if fc.strip().startswith("{"):
|
| 85 |
+
print(" Format detection: Looks like JSON", flush=True)
|
| 86 |
+
elif fc.strip().startswith("<"):
|
| 87 |
+
print(" Format detection: Looks like XML", flush=True)
|
| 88 |
+
elif fc.strip().startswith("---"):
|
| 89 |
+
print(" Format detection: Looks like YAML", flush=True)
|
| 90 |
+
else:
|
| 91 |
+
print(f" Format detection: Unknown (starts with '{fc[0]}')", flush=True)
|
| 92 |
+
|
| 93 |
+
# Log action attributes
|
| 94 |
+
print(f" Action attributes: {dir(action)}", flush=True)
|
| 95 |
+
try:
|
| 96 |
+
import json
|
| 97 |
+
print(f" Action as dict: {json.dumps(action.model_dump() if hasattr(action, 'model_dump') else action.__dict__, indent=2, default=str)}", flush=True)
|
| 98 |
+
except Exception as e:
|
| 99 |
+
print(f" Could not serialize action: {e}", flush=True)
|
| 100 |
+
|
| 101 |
+
print("="*80 + "\n", flush=True)
|
| 102 |
+
|
| 103 |
+
# Original logging (kept for continuity)
|
| 104 |
print(
|
| 105 |
f"[VALIDATOR SUBMITTED] task={task_id} "
|
| 106 |
+
f"fixed_config length={len(action.fixed_config) if action.fixed_config else 0} chars",
|
| 107 |
flush=True
|
| 108 |
)
|
| 109 |
+
if action.fixed_config:
|
| 110 |
+
print(f"[SUBMITTED CONFIG FIRST 200 CHARS]: {repr(action.fixed_config[:200])}", flush=True)
|
| 111 |
+
else:
|
| 112 |
+
print(f"[SUBMITTED CONFIG]: (empty or None)", flush=True)
|
| 113 |
|
| 114 |
# Run the grader (returns float for validator compatibility)
|
| 115 |
grader_result = task.grader(action.fixed_config)
|