Repository navigation
feat: BRIDGE_AGENT_TOKEN_KEY env override + orchestrator calibrate subcommand - #93
Merged
Merged
Conversation
… key readSessionToken resolved the credentials.toml key name only from the selected strategy's tokenKey, so a custom agent driven purely via BRIDGE_AGENT_BIN had to write windsurf_api_key into its own credentials.toml (or skip authenticate). The env var now wins over the strategy tokenKey, matching the BRIDGE_AGENT_* override family: BRIDGE_AGENT_TOKEN_KEY || tokenKey || "windsurf_api_key". Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
plan --cost-estimate, plans.jsonl and metrics/<run_id>.json existed but had no feedback loop: unit durations observed in real runs never flowed back into the per-scope estimate defaults. devin-orchestrator calibrate re-reads the recorded runs and aggregates observed unit durations into mean/p50 minutes — overall, per planned worker count and per unit id. Inline runs (workers=0) with no unit detail contribute their duration_s as one observation; missing/corrupt metrics files are skipped and counted. Read-only; --json prints the full report. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
AI Code Review Summary0 finding(s) across 0 reviewed file(s).
Top issuesNo issues found. LGTM ✅ Skipped files
Token usage: 0 in / 0 out. Reviewed by: ai-code-reviewer · ollama / qwen2.5-coder:1.5b |
Owner
Author
|
devin-judge (ACP, high model): |
Both sides added orchestrator CLI surface — keep all. Generated with [Devin](https://devin.ai) & QA Engineer Icaro Galvao Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Owner
Author
|
devin-judge (ACP, high model): |
Generated with [Devin](https://devin.ai) & QA Engineer Icaro Galvao Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Owner
Author
|
devin-judge (ACP, high model): |
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
BRIDGE_AGENT_TOKEN_KEYenv override inreadSessionToken(packages/bridge/src/acp-client.js). Resolution order is nowBRIDGE_AGENT_TOKEN_KEY → strategy tokenKey → "windsurf_api_key", so a custom agent driven viaBRIDGE_AGENT_BINcan read its own credentials.toml key name instead of being forced to writewindsurf_api_key. Documents the var in the file header, the function JSDoc and the README agent-config table (which previously declared verbatim that the var did not exist).devin-orchestrator calibratesubcommand closes the feedback loop onplan --cost-estimate: it re-reads recorded runs (plans.jsonl+metrics/<run_id>.json) and recomputes unit-duration defaults — mean/p50 minutes overall, per planned worker count and per unit id. Read-only, local only;--jsonprints the full report. Aggregation lives inregistry.py(calibrate()); thecli.pydiff is limited to the subparser + dispatch so it stays merge-friendly with feat: SQLite task queue + worktree fanout + switch JSONC/verify-env #92.kind/estimated_scope, so buckets are worker-count/unit-id based; per-scope recalibration would need a registry schema extension (documented in code + README).Test plan
npm testinpackages/bridge: 171 tests pass (new: env override wins overwindsurf_api_key; default key resolution unchanged).pytest packages/orchestrator/tests: 57 pass (new: calibrate aggregation, empty registry, missing-metrics skip).ruff checkclean.