Skip to content

Rebuild dev from latest upstream/main and replay 97 downstream commits - #16

Merged
Peanut-Puff merged 98 commits into
openBitFun:devfrom
Messimeimei:dev
Jul 16, 2026
Merged

Rebuild dev from latest upstream/main and replay 97 downstream commits#16
Peanut-Puff merged 98 commits into
openBitFun:devfrom
Messimeimei:dev

Conversation

@Messimeimei

Copy link
Copy Markdown

This PR rebuilds dev from the latest upstream/main and cherry-picks the 97 downstream commits from origin/main onto it, resolving conflicts along the way while preserving the 97-commit sequence.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 37335d45-4740-404e-9782-9b614aa47ff9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

JinnanDuan and others added 18 commits July 16, 2026 16:41
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>
Rewrite the README to describe BitFun-oriented Harbor integration,
document uv sync plus a bitfun-cli Docker example, and keep citation.

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>
@Peanut-Puff
Peanut-Puff merged commit ee38960 into openBitFun:dev Jul 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants