-
Notifications
You must be signed in to change notification settings - Fork 102
feat(benchmark): pre-bake hermes agent into dataset images for closed-book runs #350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
9a11d1b
9ccc416
4fcdde2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -187,10 +187,27 @@ def _install_layer(pins: dict[str, str]) -> str: | |||||||||||||||||||||
| claude_version = pins["CLAUDE_CODE_VERSION"] | ||||||||||||||||||||||
| codex_version = pins["CODEX_VERSION"] | ||||||||||||||||||||||
| opencode_version = pins["OPENCODE_VERSION"] | ||||||||||||||||||||||
| # Hermes (NousResearch hermes-agent) is a per-user uv app installed from | ||||||||||||||||||||||
| # GitHub, not an npm package. Baking it here (build-time, with host network) | ||||||||||||||||||||||
| # means the runtime install() skip-guard short-circuits, so tasks need no | ||||||||||||||||||||||
| # egress for it — enabling closed-book Hermes runs. | ||||||||||||||||||||||
| # | ||||||||||||||||||||||
| # HERMES_VERSION must name an immutable ref. A moving ref would let two builds | ||||||||||||||||||||||
| # record the same version string while installing different code, which is worse | ||||||||||||||||||||||
| # than not recording it: the manifest would assert a reproducibility it does not | ||||||||||||||||||||||
| # have. The installer script is fetched from the same ref for the same reason — | ||||||||||||||||||||||
| # pinning the agent but running whatever installer main has today reintroduces | ||||||||||||||||||||||
| # exactly the drift the pin exists to prevent. | ||||||||||||||||||||||
| hermes_version = pins["HERMES_VERSION"] | ||||||||||||||||||||||
| if hermes_version in ("main", "master", "HEAD"): | ||||||||||||||||||||||
| raise SystemExit( | ||||||||||||||||||||||
| f"HERMES_VERSION={hermes_version!r} is a moving ref and cannot be recorded " | ||||||||||||||||||||||
| "as a reproducible pin; use a tag or commit SHA" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+195
to
+206
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Use a full commit SHA for the Hermes install source. A Git tag can be deleted or repointed. The current validation also accepts other moving branch names. The same manifest value can therefore install different Hermes code.
📍 Affects 3 files
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| return f""" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| # Switchyard benchmark prebaked coding agents. | ||||||||||||||||||||||
| ENV SWITCHYARD_PREBAKED_AGENT_VERSIONS="claude-code={claude_version},codex={codex_version},opencode={opencode_version},node={node_version}" | ||||||||||||||||||||||
| ENV SWITCHYARD_PREBAKED_AGENT_VERSIONS="claude-code={claude_version},codex={codex_version},opencode={opencode_version},node={node_version},hermes={hermes_version}" | ||||||||||||||||||||||
| RUN set -eux; \\ | ||||||||||||||||||||||
| if command -v apt-get >/dev/null 2>&1; then \\ | ||||||||||||||||||||||
| apt-get update; \\ | ||||||||||||||||||||||
|
|
@@ -231,6 +248,19 @@ def _install_layer(pins: dict[str, str]) -> str: | |||||||||||||||||||||
| claude --version; \\ | ||||||||||||||||||||||
| codex --version; \\ | ||||||||||||||||||||||
| opencode --version | ||||||||||||||||||||||
| RUN set -eux; \\ | ||||||||||||||||||||||
| export HOME=/root; \\ | ||||||||||||||||||||||
| export PATH="/root/.local/bin:$PATH"; \\ | ||||||||||||||||||||||
| if command -v apt-get >/dev/null 2>&1; then \\ | ||||||||||||||||||||||
| apt-get update; \\ | ||||||||||||||||||||||
| apt-get install -y --no-install-recommends git ripgrep xz-utils; \\ | ||||||||||||||||||||||
| rm -rf /var/lib/apt/lists/*; \\ | ||||||||||||||||||||||
| elif command -v apk >/dev/null 2>&1; then \\ | ||||||||||||||||||||||
| apk add --no-cache git ripgrep xz; \\ | ||||||||||||||||||||||
| fi; \\ | ||||||||||||||||||||||
| curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/{hermes_version}/scripts/install.sh \\ | ||||||||||||||||||||||
| | bash -s -- --skip-setup --branch {hermes_version}; \\ | ||||||||||||||||||||||
|
Comment on lines
+258
to
+262
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Install Bash in the Alpine branch. The APK branch installs Proposed fix- apk add --no-cache git ripgrep xz; \
+ apk add --no-cache bash git ripgrep xz; \📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| hermes version | ||||||||||||||||||||||
| """ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Require
HERMES_VERSIONbefore indexingpins.Line 201 raises
KeyErrorwhenHERMES_VERSIONis absent.prepare_datasetvalidates only the four older pins at Line 496. AddHERMES_VERSIONtorequiredso preparation fails with the existing clear validation error.Proposed fix
🤖 Prompt for AI Agents