Skip to content

Train Harbor computer-1 through the session-server agent function - #8

Merged
celve merged 2 commits into
LIN-1985/investigate-existing-recipes-forfrom
LIN-2151/run-harbor-computer-1-through
Oct 22, 2026
Merged

celve merged 2 commits into
LIN-1985/investigate-existing-recipes-forfrom
LIN-2151/run-harbor-computer-1-through

Conversation

@celve

@celve celve commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Harbor's computer-1 could not train through agentic_tool_call.generate with harbor_agent_function.run. It fell to the default binding, which:

  • pointed it at OpenAI's endpoint;
  • let it send temperature 0.7, which the session server refuses for training;
  • passed it a max_seq_len its constructor rejects;
  • left images to litellm's metadata, which fails every Computer1 after the first in a process;
  • built Harbor's own Computer1 rather than Qwen3VLComputer1.

What changes

  • A computer-1 binding.

    • The session URL and key go on its LiteLLM.
    • Miles's temperature goes to the constructor. Every other request arg goes in llm_kwargs, which LiteLLM sends on every call: the agent loop's, both compactor summaries', and the final-answer fallback's. llm_call_kwargs reaches only the agent loop.
    • No max_seq_len; enable_images=True; provider="litellm".
    • Qwen3VLComputer1 through AgentConfig(import_path=..., name=None), since Harbor builds its registered class whenever the name is a registered one.
    • HARBOR_AGENT_MAX_ITERATIONS and HARBOR_CUA_DESKTOP_WIDTH/HEIGHT set the turn cap and the desktop.
  • Failure scoring. A computer-1 trial whose RuntimeRequestError escapes after its agent started is discarded as SandboxLost. The reasoning:

    • computer-1 turns every failed action into an observation;
    • it has no shell, and its zoom crops are clamped to the desktop;
    • so an escaping runtime error is a harness command (the screenshot) failing in the sandbox.

    Everything else is scored as before, including the token cap, context overflow, session-server 4xx/5xx other than 503, and verifier-phase failures. A raw SDK exception from the screenshot read or the verifier also still scores 0: no version-stable signal names it.

  • The compactor's summary trains, as in Miles's Terminus compaction recipe. It is the policy's own completion on the context it saw, and the only carrier of the episode's progress once the history is replaced. Train a screenshot agent through Harbor, on computer-1 tasks and OSWorld-Verified #2's generate function excluded it.

  • Launch. agentic_train_args(session_images=True) passes --use-session-server v2 --use-session-images. scripts/run_qwen3_vl_4b_harbor_cua.py --rollout-path session runs the agent function with --tito-model qwen3_vl and --max-seq-len 32768. generate stays the default, so its snapshot is unchanged.

Verification. Record: https://github.com/softlash/LIN-2151/blob/main/docs/live-checks.md, plan: https://github.com/softlash/LIN-2151/blob/main/plans/computer-1-session-binding.md

  • Offline, on a devbox with Harbor ac63e51a8f installed (so the contract tests against the real Computer1 run):
    • tests/fast/examples/experimental/harbor and harbor_cua: all passed.
    • tests/fast/launch_scripts and tests/manual/launch_scripts at this head: 14 failed, 583 passed, 10 errors. The base f5bf49da15 gives 14 failed, 580 passed, 10 errors, with the identical failure list (snapshots missing for models and launchers already on the integration branch).
    • Each fix, reverted one at a time, fails at least one test.
    • The pinned ruff, autoflake, isort and black are clean.
  • Live check 1. LIN-2045's captured episode through a standalone v2 session server with images, with Train a screenshot agent through Harbor, on computer-1 tasks and OSWorld-Verified #2's recorder between it and the engine, so Train a screenshot agent through Harbor, on computer-1 tasks and OSWorld-Verified #2's converter saw the same engine I/O.
    • Both made the same 2 samples: identical tokens, loss masks, rollout log-probs, image ids, image_grid_thw and pixel_values, and no TITO mismatch.
    • The fixture's own calls stopped at a 64-token cap and continue cut replies, which v2 refuses (409) and computer-1 never sends. So its conversation was re-sent with live replies.
  • Live check 2. Three runs of 3 Megatron GRPO steps through --rollout-path session, on Train a screenshot agent through Harbor, on computer-1 tasks and OSWorld-Verified #2's tasks on the shared sandbox service. Qwen3-VL-4B-Instruct, TP2, no recompute, 2×B200 with --attention-backend fused.
    • 264 episodes, none discarded, no agent-function failure, no TITO mismatch.
    • Trainer–engine log-prob gap 0.012–0.017 on every step.
    • A 14k compaction limit split episodes into 1–2 samples.
    • A 2-turn cap gave reward variance and real updates (grad norm 4.95, 3.71, 5.85).
  • Live evidence was taken at a007d0c78d. This head differs only in tests/fast/launch_scripts/test_run_qwen3_vl_4b_harbor_cua.py, which the live checks do not read.
  • The engines ran SGLang 3a93821 with Keep message images on pretokenized chat requests sglang#5 cherry-picked, which this needs and no Miles image carries.
  • No CI runs on this fork's pull requests.

Review. Sol, round 1 on 6d4f426650: pass, no P1.

Left by the pass (P2). A reasoning_effort in the request args would collide with Computer1's own named LiteLLM(reasoning_effort=...) and raise TypeError at construction. Stock Miles sampling never sends it. The fix is to route it through Computer1's parameter, or refuse constructor fields explicitly, with a real-constructor contract case.

Owed to the human. Nothing only Linyu can do; the three decisions above are agents', for Linyu's veto.

celve added 2 commits October 22, 2026 11:39
Bind computer-1 in harbor_agent_function: the session URL and key on its
LiteLLM, Miles's temperature on the constructor and every other request arg
in llm_kwargs so the compactor's and the fallback's calls carry them too,
no max_seq_len, images on, and Qwen3VLComputer1 through import_path.

A computer-1 trial whose own in-sandbox command fails after its agent
started is discarded as SandboxLost. The Qwen3-VL launcher gains
--rollout-path session, which runs it with --use-session-server v2
--use-session-images --tito-model qwen3_vl.
execute() exports MODEL_ARGS_ROTARY_BASE for the qwen3-4B model args, and
calling it directly leaked that into every later model-args snapshot test
in the same process.
@celve
celve marked this pull request as ready for review October 22, 2026 05:03
Copilot AI balanced review requested due to automatic review settings October 22, 2026 05:03

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-10-22T05:04:13.873410Z 6d4f426 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.

@celve
celve merged commit 4d17c36 into LIN-1985/investigate-existing-recipes-for Oct 22, 2026
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