Fix viewer analyze and Docker regressions after fork merge - #15
Open
Messimeimei wants to merge 91 commits into
Open
Fix viewer analyze and Docker regressions after fork merge#15Messimeimei wants to merge 91 commits into
Messimeimei wants to merge 91 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Specifies how `populate_context_post_run` in the existing `bitfun-cli` Harbor agent should convert BitFun's native session/trace/metrics data into ATIF v1.7 trajectories, following the `claude_code.py` pattern (_get_session_dir / _convert_events_to_trajectory) while using a cp-back finally block (Codex-style) since BitFun has no env-var knob to redirect its data directory to the harbor mount. Co-authored-by: Cursor <cursoragent@cursor.com>
Concrete 16-task TDD plan for the design captured in docs/superpowers/specs/2026-05-13-bitfun-cli-atif-adapter-design.md: SUPPORTS_ATIF, session-dir discovery, turn/round normalization (text/thinking/tool), nearest-timestamp token allocation, LiteLLM costing, ATIF v1.7 subagent embedding, populate_context_post_run, container-side cp-back, and a golden integration fixture. Co-authored-by: Cursor <cursoragent@cursor.com>
Convert BitFun session/token artifacts under logs_dir/bitfun/ into ATIF trajectories, populate AgentContext, and copy container-side artifacts back after exec. Include unit coverage and a golden fixture for end-to-end JSON shape. Document ATIF support in AGENTS.md. Co-authored-by: Cursor <cursoragent@cursor.com>
…ncated BitFun CLI 0.2.7's `exec` mode only writes a synthetic `-final-round` placeholder to `turns/turn-*.json` (with empty `toolItems` and `metadata.toolCallCount: 0`), losing all intermediate tool calls and thinking blocks. The full conversation is still preserved in `snapshots/context-NNNN.json`. Add `_synthesize_turns_from_snapshot()` to reconstruct turn-shaped data from snapshot messages (grouped by `turn_id` / `round_id`) and `_load_turns_preferring_snapshot()` to pick whichever source has more rounds. Turn files keep priority on ties so their richer metadata (`durationMs`, subagent fields) is preserved. On a real broken session this lifts the trajectory from 2 steps / 0 tool calls to 80 steps / 42 tool calls, matching the BitFun runtime log (`rounds=40, total_tools=42`). Co-authored-by: Cursor <cursoragent@cursor.com>
Let Harbor Viewer job/trial Analyze use multiple Anthropic-compatible providers (direct API, corporate proxy, etc.) without hard-coding a single model list. - Add TOML profile loader (harbor.analyze.profiles) with built-in Anthropic fallback; secrets stay in process env via api_key_env / base_url_env, not in the config file - Expose GET /api/analyze/profiles; extend summarize POST to accept profile_id + model_id while keeping legacy model field - Inject per-request SDK env overlay in Analyzer/query_agent so credentials are not written to global os.environ - Add harbor view --analyze-profiles and HARBOR_ANALYZE_PROFILES for production and dev reload workers - Update Viewer UI with Profile + Model pickers when profiles are available; fall back to Haiku/Sonnet/Opus on fetch errors - Add examples/config docs, example TOML, and unit tests Co-authored-by: Cursor <cursoragent@cursor.com>
Document argv/stdin/Read fallback for large job-level analyze prompts and the approved design for implementation. Co-authored-by: Cursor <cursoragent@cursor.com>
TDD implementation plan for argv/stdin/Read fallback and Viewer 422 errors. Co-authored-by: Cursor <cursoragent@cursor.com>
Route oversized aggregation prompts via stdin and agent Read when argv limits are exceeded; surface AggregateTransportError as Viewer 422. Co-authored-by: Cursor <cursoragent@cursor.com>
Provide root-level one-case and all-cases YAML configs so bitfun-cli Docker runs can be started with harbor run -c. Co-authored-by: Cursor <cursoragent@cursor.com>
Capture approved design for mkdir/pipeline exit-code handling, failure log persistence, cp-back observability, and env consistency. Co-authored-by: Cursor <cursoragent@cursor.com>
Task-by-task TDD plan covering run shell, failure log persist, env merge, _exec override, and cp-back gap logging. Co-authored-by: Cursor <cursoragent@cursor.com>
Ensure /logs/agent exists before tee, return bitfun-cli exit via PIPESTATUS, persist exec output to trial agent/bitfun.txt on failure, merge config agent env into run/cp-back, and log missing cp-back artifacts. Co-authored-by: Cursor <cursoragent@cursor.com>
SWE-bench Pro images use WORKDIR /app, so forcing /testbed caused docker exec chdir failures on agent run. Co-authored-by: Cursor <cursoragent@cursor.com>
This reverts commit abb7ff7.
Preserve BitFun latency and output tokens-per-second in ATIF metrics.extra and surface summary and step-level TPS in Harbor view. Co-authored-by: Cursor <cursoragent@cursor.com>
The summary TPS builder filtered out subagent records, which was dead code for main trajectories (already filtered upstream) but blanked all summary TPS for subagent trajectories even though their step-level TPS was still computed. Iterate over the trajectory's own records instead so subagent summaries get TPS consistently. Also round completion_tokens_per_second to 2 decimals before persisting, and document the end-to-end-latency TPS semantics and the deliberate step-vs-summary key naming difference. Update the bitfun golden fixture so the subagent final_metrics carry the missing_latency marker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This reverts commit 2210319.
fix(test): skip when windows container is not ready Co-authored-by: Cursor <cursoragent@cursor.com>
Restore upstream docker environment after cherry-pick conflict resolution, wire AggregateTransportError handling in the viewer summarize API, and align analyze-related tests with the current run_analyze flow. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Install ca-certificates in the hello-world Docker image so bitfun-cli can call HTTPS APIs from trials, and add a script to render a Harbor job config from .env credentials. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
docker.pyand re-apply Windows agent setup inbase.py, fixingharbor runfailures (COMPOSE_BASE_PATHimport error) after cherry-pick conflict resolution.AggregateTransportErroras 422, and update summarize tests for multi-provider analyze.ca-certificates) and addscripts/render-bitfun-hello-world-job.pyfor runningbitfun-clion hello-world from.envcredentials.Test plan
uv run pytest tests/unit/— 4874 passeduv run harbor run -p examples/tasks/hello-world -a oracle -e docker -y— Mean 1.000uv run harbor run -c /tmp/bitfun-hello-world.yaml -y(rendered viascripts/render-bitfun-hello-world-job.py) — Mean 1.000