Skip to content

Run the agent under Harbor task benchmarks, optionally on a ChatGPT plan - #7

Merged
lydakis merged 5 commits into
mainfrom
claude/project-thread-4opvst
Sep 24, 2026
Merged

lydakis merged 5 commits into
mainfrom
claude/project-thread-4opvst

Conversation

@claude

@claude claude Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Before: this harness had no way to run the task benchmarks other harnesses report, such as Terminal-Bench 2.1, SWE-bench or tau-bench. So it could not be compared with Strands, Claude Code or Codex on the same model and the same tasks.

After: harbor run -a bench.harbor_agent:Agent -m PROVIDER/MODEL runs one bot per task inside Harbor's task containers and reports tokens and cost back to Harbor. If the model is named chatgpt/MODEL, the runtime signs in with the ChatGPT login Codex saved, so test runs are billed to a ChatGPT plan instead of API tokens.

How: bench/harbor_agent.py is a Harbor installed agent. It works in four steps:

  • Install: uploads a static musl build and installs bash, plus CA roots when the image has none.
  • Run: runs agent run --new --bot task --agents.
  • Finish: after the turn, and also when Harbor's agent timeout cancels it, the adapter saves every bot's turns and stats. It then runs agent shutdown, which cancels any turn still running and now returns only once the daemon has exited. The store is copied after that.
  • Report: tokens are grouped by model across all bots and priced at each model's rates. Provider error codes map to Harbor's retryable error types.

The runtime gets a new chatgpt provider name. It targets https://chatgpt.com/backend-api/codex with the Responses family and reads access_token and account_id from $CODEX_HOME/auth.json. It sends the ChatGPT-Account-ID header, and startup fails with provider_login_unavailable when there is no login. The login is used only at that exact URL, and the token is never refreshed. The adapter uploads only those two fields into containers.

docs/HARBOR.md records the vendor claims, the run commands and the gaps that remain before a comparison can be published.

Validation:

  • Ran the Harbor 0.23.0 hello-world task against a scripted Responses endpoint. Reward was 1.0, tokens were recorded, and the store was copied after the daemon exited cleanly. An endpoint returning 401 gave reward 0 and AgentAuthenticationError.
  • Ran a task with a 15-second agent timeout whose model asked for sleep 120. The trial ended in AgentTimeoutError about 15.4 seconds after it started, and the copied store shows the turn as interrupted.
  • Rust tests cover the account header on requests, reading the login and the endpoint restriction. tests/test_cli.py checks that shutdown returns only after the daemon has exited; this test fails without the change. tests/test_harbor_agent.py runs under Harbor's Python and covers the minimized login, per-model pricing, the finishing command and cleanup after a timeout.
  • cargo test, cargo clippy -D warnings and all 226 Python tests pass.
  • Not yet run against a real model, the real ChatGPT backend or a published dataset.

🤖 Generated with Claude Code

bench/harbor_agent.py is a Harbor installed agent: it uploads a static Linux
build, runs each task as one `agent run` bot, and reports daemon-wide tokens,
LiteLLM cost, and provider failures as Harbor's retryable error types. It
installs a CA bundle when the image has none, because the HTTP client needs
platform roots to start. docs/HARBOR.md records what Strands and Unreal
report, the local validation, the commands to run, and the gaps before a
comparison is publishable.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013RhkQCvP5uTYjUeMBnFzDp
`--provider chatgpt` sends Responses requests to the ChatGPT backend Codex
uses, with the access token and ChatGPT-Account-ID read from Codex's
auth.json at daemon start. The token is redacted from tool output like a
key and never refreshed here. The Harbor adapter copies that login into
each task container for chatgpt/MODEL runs, so benchmark tests can use a
ChatGPT plan instead of API tokens.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013RhkQCvP5uTYjUeMBnFzDp
@lydakis
lydakis marked this pull request as ready for review September 23, 2026 23:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T02:33:42.551894Z bb1054c Manual request
🔒 Security Review ✅ Completed 2026-09-24T00:08:15.127009Z 3f435f2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f435f253c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bench/harbor_agent.py Resolved
Comment thread src/server/mod.rs Resolved
Comment thread bench/harbor_agent.py Resolved
Comment thread bench/harbor_agent.py Resolved
Comment thread bench/harbor_agent.py Resolved
Comment thread bench/harbor_agent.py Resolved
…atGPT login to its endpoint

Review findings on the Harbor adapter and the chatgpt provider:

- The ChatGPT login goes only to https://chatgpt.com/backend-api/codex. A
  chatgpt spec naming another URL authenticates with its key variable or
  nothing, so a local or synthetic endpoint never receives the real token.
- The adapter uploads only the access token and account id, not Codex's
  whole auth.json with its refresh and ID tokens.
- Bookkeeping runs after the turn and also when Harbor's agent timeout
  cancels it: every bot's turns and stats are saved, then shutdown cancels
  any running turn so nothing bills past the deadline.
- `agent shutdown` returns once the daemon process has exited (the ready
  line now carries its pid), so the store copy is taken after the final
  commit and checkpoint.
- Tokens are grouped by model across every bot's turn records and priced at
  each model's rates; an unpriced model leaves the cost empty.
- provider_stream_failed, truncated_sse_frame and provider_admission_timeout
  map to NetworkConnectionError, like the other transient transport codes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013RhkQCvP5uTYjUeMBnFzDp
@lydakis

lydakis commented Sep 24, 2026

Copy link
Copy Markdown
Owner

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb1054c6d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bench/harbor_agent.py Resolved
Comment thread bench/harbor_agent.py Resolved
Comment thread docs/HARBOR.md Resolved
…n only when used

- Accounting reads every bot's turns from the store copied after shutdown,
  not from the running daemon, so a delegated bot's last call or a bot
  created at the end is counted. The finish step no longer lists bots.
- The adapter uploads Codex's login only when a spec makes the daemon read
  it: chatgpt at its own endpoint with no key variable. A keyed or custom
  chatgpt endpoint gets nothing and needs no Codex login.
- The module docstring uses `-a module:Class`, as Harbor 0.23 documents;
  `--agent-import-path` is its deprecated alias.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_013RhkQCvP5uTYjUeMBnFzDp
@lydakis
lydakis merged commit e2fd9e3 into main Sep 24, 2026
1 check passed
@lydakis
lydakis deleted the claude/project-thread-4opvst branch September 24, 2026 02:50
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.

2 participants