Repository navigation
Conversation
Contributor
Author
|
/ok to test cb77043 |
ffrujeri
force-pushed
the
ffrujeri/bird-interact-adk-parity
branch
from
November 4, 2026 21:33
cb77043 to
478d3bc
Compare
Contributor
Author
|
/ok to test 478d3bc |
…tor and grading auto-ontology-eval runs BIRD-Interact Lite and Full query tasks on the ADK's orchestrator, user simulator and grader. Bring the Environment Server to parity with what it uses, at ADK revision 451fe2c3518ee1cf908d8139e2913483bd519381: - c-Interact is the ADK's protocol: the agent gets ask_user and submit_sql, the ADK's instruction and tool descriptions, and each turn is opened with the orchestrator's phase-1, debug or follow-up message. A turn ends at its submission; each phase has two turns; rewards follow the phase's submissions. - The user simulator is the ADK's two-stage pipeline with its v2 prompts, sampled at temperature 0, and its clause split of the solution (sqlglot). Its placeholders are filled in one pass, so a question cannot pull the solution SQL into the prompt as the ADK's sequential fill would. - Grading is the ADK's default test case, edge cases included, run in its order on one database state; PostgreSQL scripts are sent whole; phase 1's passing SQL is applied for phase 2, and replayed on a fresh sandbox. - Query phases are graded by their result even when they have test cases; only a non-query phase with test cases is refused (server) or left out (prepare.py), as the ADK decides by category. The ADK's texts are copied verbatim into adk_prompts.py, with its MIT notice and revision, and recorded in ATTRIBUTIONS.md. Validation: server tests 64 passed, 4 skipped (real PostgreSQL, run in the Lite image instead); prepare tests 7 passed; the ADK's own grading against grading.py on six Lite databases agreed on 863 of 863 submissions; the example tasks with real models on Docker, 10 of 10 (mean reward 0.82); Lite on PostgreSQL through the recipe, with a stand-in ground truth for three tasks, in both modes on Docker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Felipe Vieira Frujeri <ffrujeri@nvidia.com>
ffrujeri
force-pushed
the
ffrujeri/bird-interact-adk-parity
branch
from
November 6, 2026 17:23
478d3bc to
33211b2
Compare
Contributor
Author
|
/ok to test 33211b2 |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #5475 (the Lite and Full recipe), in the BIRD-Interact stack: #5465 → #5409 → #5473 → #5475 → this PR. The diff against #5475 is the
bird_interactEnvironment Server, the recipe'sprepare.pyand README, andATTRIBUTIONS.md.What changed
auto-ontology-eval runs BIRD-Interact's Lite and Full query tasks in c-Interact on the BIRD-Interact ADK: its orchestrator, its user simulator and its grader. This PR brings the
bird_interactEnvironment Server to parity with what it uses, at ADK revision451fe2c3518ee1cf908d8139e2913483bd519381.orchestrator/cinteract.py:max_turn, the phase-1, debug and follow-up messages, two runs for each phaseapp.py:_first_request,_next_messagesystem_agent/agent.py,tools.py,callbacks_cinteract.py: the instruction,ask_userandsubmit_sql, one submission for each runapp.py:CInteractToolsdb_environment/server.py: the grader's messages, rewards by submission count, the phase-1 snapshot, the knowledge the agent seesapp.py:submit;grading.pyshared/db_utils.py:test_case_defaultand its rewritesgrading.pyuser_simulator/: the two stages, thev2prompts, the clause split (sqlglot)simulator.pydirect_httpormcp. The server sends the ADK's instruction and phase-1 message, then opens each later turn as the orchestrator does: the debug message after a failed phase (with the SQL error when the submission did not run), the follow-up question after phase 1 passes. A turn ends at its submission; a later call in the turn gets the ADK agent's reply. Rewards follow the phase's submissions, as in the ADK. This replaces feat(bird_interact): run BIRD-Interact in its Environment Server, with no Resources Server #5409's conversational c-Interact, where the agent's reply text was parsed for SQL.max_turnsis gone: the protocol fixes the turns.v2prompts, the action parser and the response generator at temperature 0 with its output limits, the ambiguity JSON as the row writes it, the solution split into clauses withsqlglot, and phase 2's prompts. The one deliberate difference: the ADK fills its placeholders one after another, so an agent's question containing[[GT_SQL]]would get the solution SQL written into the simulator's prompt; Gym fills them in one pass.DISTINCTandROUNDrewrites, in that order on one database state, rolled back; each query keeps its last statement's rows, at most 10,000. Edge cases are kept for parity, such as an array of decimals failing because it cannot be written as JSON. A PostgreSQL query is sent whole, so dollar-quoted bodies work. Phase 1's passing SQL is applied for phase 2, and replayed when a sandbox is replaced.sql_timeout_secondsdefaults to the ADK's 60.prepare.pyleaves it out. Every query task's follow-up is a query, so all 195 Lite and 410 Full query tasks run.user_model(user_model_nameinenv.yaml). The READMEs say that the ADK default, which auto-ontology-eval uses, isanthropic/claude-haiku-4-5-20251001.Why
auto-ontology-eval's BIRD-Interact results come from the ADK. With the same protocol, simulator and grading, its runs can move to Gym without a change in what is measured. Tracking: GYMINT-646 and GYM-1103 (Linear).
Code provenance
environment_servers/bird_interact/adk_prompts.pyholds texts copied verbatim from the BIRD-Interact ADK, revision451fe2c3518ee1cf908d8139e2913483bd519381, under the MIT license (Copyright (c) 2025 BIRD-Interact Authors), whose notice the file's header reproduces:adk_prompts.pyBIRD-Interact-ADK/user_simulator/prompts.pyv2_action_parser,v2_response_generatorBIRD-Interact-ADK/user_simulator/server.pyBIRD-Interact-ADK/system_agent/agent.pyCINTERACT_INSTRUCTIONBIRD-Interact-ADK/system_agent/tools.pyask_userandsubmit_sqldocstrings, the submission reply's linesBIRD-Interact-ADK/system_agent/callbacks_cinteract.pyBIRD-Interact-ADK/orchestrator/cinteract.pyBIRD-Interact-ADK/db_environment/server.pyThe texts are byte-for-byte; the ADK's f-strings are
str.formattemplates.ATTRIBUTIONS.mdrecords the component. The code that uses them (protocol, simulator pipeline, grading) is an independent implementation.Validation
pytest environment_servers/bird_interact/tests(server venv)initdbon the host (run in the image instead, below)pytest benchmarks/bird_interact/teststest_case_defaultand submit flow againstgrading.py, in the Lite imageDISTINCTandROUNDrewrites, comments, ordering, decimals, dates, JSON, numeric and date arrays, multi-statement and writing submissionsgrading.pyin the Lite imagetest_phase_2_sees_what_phase_1_changed_even_on_a_fresh_sandboxtests/unit_tests(benchmark, manifest, import, sandbox and Environment Server selections)test_opensandbox_compose.py,test_sandbox_transfer.py,test_sandbox_stop_retry.py,test_harbor_validation.pyandtest_benchmarks.py, the same with and without this PR's changes on this machinepre-commit run --fileson the changed filesNot validated yet: runs with the real ground truth (GYMINT-592); the Full image build and a Full run; a run with the ADK's simulator model.
Rollout evidence
All on Docker sandboxes, with
simple_agent; policyazure/openai/eccn-gpt-6.1-sol, simulatoropenai/openai/eccn-gpt-6-luna:data/example_rollouts.jsonl. c-Interact took each path but phase 2's debug turn: questions with the clarification note, a failed submission and its debug turn passing for 0.5, the follow-up as phase 2.solar_10passed both phases (1.0);solar_3passed phase 1, failed phase 2 and its debug turn (0.7);crypto_2failed phase 1 and its debug turn (0.0). A secondsubmit_sqlin one turn got the ADK's "SQL submitted. Awaiting result." a-Interact: 3 of 3 completed, mean 0.9.One simulator reply in the example run was the action itself (
unlabeled("JOIN")): the simulator model continued the ADK's prompt, which ends in an open<s>, with the action. The ADK reads it the same way.Compatibility
Within the unmerged stack: c-Interact's protocol, stop reasons and grading change, so c-Interact scores from #5409's server are not comparable with these.
max_turnsis removed from the server's config. c-Interact now needs a harness that resumes its session and takes tool grants:simple_agentdoes; OpenCode, which ran #5409's c-Interact, refuses required tool grants. a-Interact keeps its tools and budget; itssubmitnow replies with the grader's messages. New dependency for the server:sqlglot==30.20.0.🤖 Generated with Claude Code