Repository navigation
fix(harbor): fix bridge tool names, macOS downloads, aggregate jobs and 3.9 graders - #849
Conversation
…nd 3.9 graders Four independent fixes to the Tier 3 Harbor runtime: - The NVIDIA Build bridge rejects backend tool-call names outside [A-Za-z0-9_-] before any Anthropic or Responses stream event, so a completion with such a name never reaches the agent. The client gets a 502 backend_error instead. - Local directory downloads pack with COPYFILE_DISABLE=1 so macOS tar does not add AppleDouble members for extended attributes. Those members made the transfer check fail on ._ source files that do not exist. - Merged aggregate Harbor jobs get a job.log provenance record naming their source jobs, so Harbor's analyzer can discover them. - The custom grader runner uses an (int, float) isinstance tuple, so it runs on Python 3.9 task interpreters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
rng1995
left a comment
There was a problem hiding this comment.
Thanks @rng1995 for this contribution. The source changes look good. All four comments are about test coverage and release-note wording: two new regression tests do not guard their fixes in CI, one log assertion depends on timing, and the CHANGELOG entry understates the effect on users. Findings: 4 P3 (no P1 or P2).
Run the AppleDouble download test in the Tier 3 macOS job and list its file in the CI change classifier. Extend the Python 3.9 verifier smoke check to stage the custom grader runner and score a stub grader in both custom grading modes. Wait for the bridge worker before reading the 502 log line, and read the log as UTF-8. Describe the effect of the Python 3.9 grader failure on scores in the changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
chrisknvidia
left a comment
There was a problem hiding this comment.
Thanks, this is a tidy set of fixes, and the second commit closes out the earlier review points: the macOS test now runs in the tier3-macos job with the classifier list kept in sync, the Python 3.9 smoke step exercises the grader runner, the 502 log assertion waits for the worker, and the changelog says what users actually saw.
What I verified:
- Bridge: the check sits in
_validate_chat_tool_call, which both translators already pass through. The bridge's own generated names (_chat_tool_alias, namespace flattening) stay inside[A-Za-z0-9_-], so nothing the bridge produces can trip it. The new unit and HTTP tests fail on main and pass here. - macOS downloads:
COPYFILE_DISABLEis per-exec only (Harbor's_merge_envdoes not persist it), it passes the env filter, and the sandbox bootstrap hands it totar. On a Mac where new files pick upcom.apple.provenancexattrs, ten existing download tests intests/test_harbor_local_environment.pyfail on main with the same._FileNotFoundError and pass with this change, so the fix matters beyond the new test. - Aggregate
job.log: Harbor only checks that the file exists and never parses it, so the JSON record is safe. The new test fails on main with Harbor's "not a job directory (no job.log)" error and passes here. - Python 3.9 grader: ran the template under a real 3.9.6 with the smoke script's stub grader in both modes. This branch passes; main's template raises the
TypeErrorin_numeric, and indefault_plus_custommode that is what turned a 0.8 default score into 0.0. The template already hasfrom __future__ import annotations, so thefloat | Noneannotations are fine, andast.parse(..., feature_version=(3, 9))accepts it. - CI routing: adding the file to
TIER3_PLATFORM_TESTSmakes changes to it trigger the macOS job; it skips nothing.tests/test_ci_workflows.pyandtests/test_ci_change_classifier.pypass.
The three red Tests jobs are tests/test_cli_banner.py::test_noninteractive_invocations_preserve_streams_and_exit_codes[args2-0-stdout] (-h exits 2). The same test fails the same way on several other open PRs from the same window and this PR does not touch the CLI, so that one is not yours.
Not blocking: four unrelated fixes in one PR is more than I would normally take, since PRs land as one squashed commit and reverting one fix means reverting all four. It is fine this time because each is a few lines with its own regression test, but please split next time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Summary
Four independent fixes to the Tier 3 Harbor runtime.
/v1/messages), the in-trial NVIDIA Build bridge accepts only tool names made of letters, digits,_and-in what it sends to the backend: it drops other declared tools and refuses replayedtool_useblocks with such names. It did not check the tool-call names in the backend's completions. A completion that called a tool such asbad.toolwas streamed to the agent, and once that call was in the conversation history, every later Messages request that replayed it was refused. The bridge now checks the tool-call names in every completion on both the Messages and the Responses (/v1/responses) routes. If any name falls outside[A-Za-z0-9_-], it rejects the whole completion before the first stream event, and the client gets a502backend_errorwith no partial stream. The Responses route still forwards declared function tools and replayedfunction_callitems with any name, so on that route a backend call to a declared tool whose name falls outside that set, which was streamed before, is now also refused with a502. OpenAI-compatible clients such as Codex already limit tool names to that set. Valid names that the request did not declare are still passed through on both routes.taradds._<name>AppleDouble members for files and directories that carry extended attributes. When the local environment packed a directory to download it, those synthetic members made the download fail: the transfer check looks up each archive member in the source directory, and no such._file exists there. The pack command now runs withCOPYFILE_DISABLE=1. Real._files that a user wrote are still copied, and the containment checks are unchanged.job.log, which the aggregate did not have. The aggregate now gets ajob.logholding a JSON record:kind: "skillevaluator_retained_aggregate", the aggregate job name and id, the trial total, the name of each source job and, when that job'sresult.jsonparses as a Harbor job result, its id, and a note that the trials were retained from source jobs and not run again. The record does not claim a new agent execution.python3. It checked scores withisinstance(value, int | float), which raisesTypeErroron Python 3.9. The runner's error handler then wrote an overall score of 0.0 toreward.jsonandreward.txt, so on a task image whosepython3is 3.9 every custom-graded trial scored 0.0, and indefault_plus_custommode SkillEvaluator's own default score (for example 0.8) was replaced with 0.0 as well. It now usesisinstance(value, (int, float)). Booleans, non-finite values and values outside[0, 1]are still rejected. Evaluations that ran custom graders on such images should be rerun.Changes
src/skillevaluator/tier3/harbor/nvidia_build_bridge.py:_validate_chat_tool_call, which checks completions for both routes, rejects a tool-call name that_is_chat_tool_namedoes not accept (tool call name is unsupported by NVIDIA Build). Request translation is unchanged.src/skillevaluator/tier3/harbor/local_environment.py: run the directory-packtarcommand withenv={"COPYFILE_DISABLE": "1"}.src/skillevaluator/tier3/harbor/runner.py: in_merge_attempt_jobsonly, record each source job's name, and its id when itsresult.jsonparses, and write the aggregatejob.log.src/skillevaluator/tier3/harbor/templates/custom_grader_runner.py: use the(int, float)tuple in_numeric.tests/test_nvidia_build_bridge.py: malformed names (.,:,/, space, newline, en dash) fail before any Anthropic or Responses event; valid unregistered names, including a 96-character one, still work; over HTTP, on both/v1/messagesand/v1/responses, a malformed name is a502with noevent:lines, the name is not echoed, and, once the bridge worker has finished, the bridge log recordsinvalid_backend_response.tests/test_harbor_local_environment.py: macOS-only test that both download methods keep an authored._authored.txt, add no generated._members afterxattris set on the directory and a selected file, and leave the source and environment root unchanged.tests/test_harbor_runner_status.py: merging two attempts produces an aggregate that the installed Harbor analyzer (_resolve_trial_dirs) andJobScannerfind, with ajob.logthat names the aggregate and both source jobs.tests/tier3/test_judge_failure_artifacts.py: addTrueandFalseto the rejected score cases..github/workflows/ci.ymlandscripts/classify_ci_changes.py: run the macOS-only AppleDouble test in thetier3-macosjob, which runs on pull requests, and addtests/test_harbor_local_environment.pyto the classifier's list of the test files that job runs.scripts/ci/smoke_harbor_verifier.py: the Package job's Python 3.9 step also stagescustom_grader_runner.pynext to the verifier and runs it with a stub grader incustom_onlyanddefault_plus_custommodes. It checks the written scores, that a boolean custom metric is dropped, and that the default overall score of 0.8 is kept indefault_plus_custommode.CHANGELOG.md: four entries under## Unreleased/### Fixed.Verification
make lintmake testmake buildRan locally on macOS (Python 3.12, Harbor 0.25.0,
pytest -n 3):tests/test_nvidia_build_bridge.py,tests/test_harbor_local_environment.py,tests/test_harbor_runner_status.py,tests/tier3/test_judge_failure_artifacts.py): 531 passed, 2 skipped (Windows-onlytaskkillcases). This includes the 27 new cases, and the macOS-only AppleDouble test ran. Two other runs of the same modules on a heavily loaded machine had timing failures in tests this PR does not change:test_bridge_ready_file_creation_refuses_symlinks(3-second subprocess timeout) once, andtest_bounded_harbor_process_failure_reaps_descendants[timeout]in both. Both passed when rerun on this branch, and the second also fails under load on unchangedmain._merge_attempt_jobs, and the runner-artifact tests;tests/test_harbor_runtime_skill_isolation.pyfor the grader template; andtests/test_oss_packaging.py): 1550 passed, 3 skipped, 2 failed. Both failures are environment-only:tests/test_tier3_public_runtime.py::test_verifier_refreshes_adc_token_on_401_for_vertex_openapiand::test_verifier_refreshes_adc_token_on_401_via_gcloud_clifail with the sameUnexpected auth headerassertion on unchangedmain, because they pick up the test machine's Google ADC setup.tests/test_ci_workflows.pyandtests/test_ci_change_classifier.py(which check the CI jobs' test lists against the classifier), and 12 modules that readCHANGELOG.mdor the CI scripts (tests/ci/test_image_build.py,tests/test_select_docs_tests.py,tests/test_benchmark_rollout_docs.py,tests/test_tier3_progress.py,tests/test_oss_packaging.py,tests/test_harbor_claude_refusal_fallback.pyand six Tier 3 report and dataset modules): 1703 passed, 2 skipped.ruff checkandruff format --checkon the 10 changed Python files: passed.Two of these fixes need a specific platform or interpreter, which the default CI test jobs do not provide:
tier3-macosjob, which runs on pull requests. With theCOPYFILE_DISABLEchange reverted, both parameterisations fail locally withFileNotFoundErroron a generated member:download_dir_with_exclusionson._., which the directory's extended attribute produces, anddownload_dir_filteredon._keep.txt, because it archives only the selected files.int | floatworks, and the addedTrue/Falsecases also pass onmain. The Package job's Python 3.9 step now runs the custom grader runner, as described under Changes. Locally, with a Python 3.9.6 task interpreter, that step passes on this branch and fails withmain's template in place, withTypeError: unsupported operand type(s) for |incustom_onlymode. Run directly under Python 3.9.6 indefault_plus_custommode,main's template replaced a default score of 0.8 with 0.0 inreward.txtandreward.json. Loaded under Python 3.9.6, this branch's_numericreturns0.5,1.0and0.0for0.5,1and0, andNoneforTrue,False, NaN, infinity,-0.01,1.01and the string'0.5'.Release Impact
CHANGELOG.md🤖 Generated with Claude Code