Skip to content

Remove GET /get_problem; pass problem_id via SREGYM_PROBLEM_ID (Fixes #788) - #844

Merged
Saadmrp1038 merged 4 commits into
SREGym:mainfrom
selen0phile:fix/788-remove-get-problem
Jun 5, 2026
Merged

Saadmrp1038 merged 4 commits into
SREGym:mainfrom
selen0phile:fix/788-remove-get-problem

Conversation

@selen0phile

Copy link
Copy Markdown
Contributor

Remove /get_problem conductor endpoint

Fixes #788

See also #788 — Conductor API exposes /get_problem.

Why this change

The conductor exposed GET /get_problem, which returns the canonical problem_id (for example node_conntrack_exhaustion_hotel_reservation). That route appeared in /openapi.json, so eval agents could discover it and call it directly. The id string often reveals the fault, which undermines the benchmark.

This PR removes the endpoint. Client drivers still need problem_id for log and artifact naming only. The orchestrator already knows the id when it starts a run, so we pass it to drivers via SREGYM_PROBLEM_ID instead of the public HTTP API.

What changed

  • Removed GET /get_problem from [sregym/conductor/conductor_api.py](sregym/conductor/conductor_api.py).
  • Added [clients/harness/problem_id.py](clients/harness/problem_id.py) with resolve_problem_id():
    • --problem-id if provided (standalone driver runs)
    • else SREGYM_PROBLEM_ID env var (set by main.py, forwarded into containers by AgentLauncher)
    • else "unknown" with a warning
  • Updated [main.py](main.py): before launching an agent, set SREGYM_PROBLEM_ID; clear env after agent cleanup.
  • Updated [sregym/agent_launcher.py](sregym/agent_launcher.py): pass SREGYM_PROBLEM_ID into container env when starting isolated agents (stratus, codex, claudecode, etc.).
  • Updated drivers: claudecode, codex, gemincli, opencode (--problem-id added), tierzero, stratus, demo.
  • Removed unused benchmark_current_problem from [clients/stratus/configs/langgraph_tool_configs.py](clients/stratus/configs/langgraph_tool_configs.py).

Unchanged: grading flow, agent prompts (/get_app only), /status, /submit, and submit MCP.

How it works now

main.py (knows pid)
  ├─ SREGYM_PROBLEM_ID=pid
  └─ AgentLauncher → forwards SREGYM_PROBLEM_ID into the agent process/container

driver (host or container)
  └─ resolve_problem_id() reads SREGYM_PROBLEM_ID or --problem-id (no HTTP)

eval agent
  └─ /get_app, /status, /submit only

Standalone driver runs can still pass --problem-id <id> when not launched via main.py.

Testing performed

Environment: cluster verification healthy (kind cluster, 106 problems in registry, LLM judge configured).

Static and unit-level

Check Result
grep '/get_problem' in *.py No matches
resolve_problem_id via SREGYM_PROBLEM_ID Pass
AGENT_LOGS_DIR=/logs without env returns unknown (not logs) Pass
CLI --problem-id overrides env Pass
Driver module imports (claudecode, codex, stratus) Pass
claudecode.driver --help shows --problem-id Pass

API routing (FastAPI TestClient)

Check Result
/openapi.json omits /get_problem Pass
GET /get_problem 404
GET /get_app, /status without conductor 400 (expected)
With mocked active conductor: get_app / status 200, get_app body has no problem_id Pass

Live benchmark: debug agent

KUBECONFIG="$SREGYM_KUBECONFIG" uv run python main.py --agent debug --problem service_port_conflict_hotel_reservation --n-attempts 1 --agent-timeout 90
Check Result
Benchmark completed Pass (results/0601_1119/debug/...)
curl http://127.0.0.1:8000/get_problem during run HTTP 404
OpenAPI during run /get_app, /status, /submit only; no /get_problem
get_app during run 200, returns app metadata (no problem id)

Live benchmark: stratus agent (container)

KUBECONFIG="$SREGYM_KUBECONFIG" uv run python main.py --agent stratus --problem service_port_conflict_hotel_reservation --model gpt-5 --n-attempts 1

Run directory: results/0601_1242/stratus/service_port_conflict_hotel_reservation/run_1/

Check Result
SREGYM_PROBLEM_ID passed into container Pass (SREGYM_PROBLEM_ID=service_port_conflict_hotel_reservation on docker run)
Stratus diagnosis + mitigation Pass (kubectl investigation and patch in driver.log)
No get_problem HTTP calls in run artifacts Pass
/get_problem at driver startup (old image) 404 Not Found (endpoint removed as intended)

Note: The agent Docker image bundles driver code at build time. If the image was built before this branch, the container may still log a one-time failure from the removed get_curr_problem path even though the benchmark proceeds. Rebuild to pick up the updated stratus driver:

KUBECONFIG="$SREGYM_KUBECONFIG" uv run python main.py --agent stratus --problem service_port_conflict_hotel_reservation --model gpt-5 --n-attempts 1 --force-build

After rebuild, expect Problem ID (harness): service_port_conflict_hotel_reservation in driver.log and CSV/trajectory filenames using that id (not error or logs).

Live benchmark: codex agent (container, rebuilt image)

bash docker/agents/build.sh   # or: main.py ... --force-build
KUBECONFIG="$SREGYM_KUBECONFIG" uv run python main.py --agent codex --problem service_port_conflict_hotel_reservation --model gpt-5 --n-attempts 1
Check Result
Image rebuilt (sregym-agent-base:latest) Pass
SREGYM_PROBLEM_ID in container Pass (service_port_conflict_hotel_reservation)
Problem ID (harness): service_port_conflict_hotel_reservation in driver.log Pass
No get_problem in driver.log Pass
Artifacts under correct problem_id path (not error / logs) Pass
Driver exit (driver.rc) 0
Benchmark completed Pass (~13:10–13:28)
Diagnosis / mitigation scores Failed (agent mis-diagnosed; unrelated to #788 harness)

@Saadmrp1038
Saadmrp1038 self-requested a review June 1, 2026 15:43
@Saadmrp1038
Saadmrp1038 merged commit 963dfc2 into SREGym:main Jun 5, 2026
6 checks passed
@Saadmrp1038

Copy link
Copy Markdown
Collaborator

Works Great!

@selen0phile

Copy link
Copy Markdown
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conductor API exposes /get_problem endpoint

2 participants