Skip to content

feat(learning): migrate retrospective to daily rolling-PR model + bump engine - #245

Merged
eric-wang-1990 merged 2 commits into
mainfrom
ai/modernize-learning-retrospective
Aug 13, 2026
Merged

eric-wang-1990 merged 2 commits into
mainfrom
ai/modernize-learning-retrospective

Conversation

@eric-wang-1990

Copy link
Copy Markdown
Collaborator

What

Migrate the engineer-bot learning (retrospective) flow from the legacy per-PR model to the engine's current daily cron + adaptive-cursor model, and bump the engine pin so the invocation matches the engine it runs against. Three coupled changes:

File Change
.github/actions/bot-prelude/action.yml Bump engine-ref default 92b3857 → 654a31d0 (engine main, 61 commits). SHA-only — the locked SDK/CLI (0.2.102 / 2.1.61) are unchanged at that SHA.
.github/workflows/engineer-bot-learning.yml Rewrite trigger + invocation (see below).
.bot/config.yaml Close the loop + prune a dead key.

Why these are coupled

The modern retrospective.py (at the bump target) is invoked as a windowed multi-PR sweep (--window-hours / --since, adaptive cursor) that gathers each merged PR's diff and comments itself. This repo's workflow was still the old shape: pull_request: [closed] gated on merged + an extract-learning label, with a manual step that hand-gathered a single PR's context into pr_diff.txt / review_comments.txt. Bumping the engine without migrating the trigger would leave a modern engine driven by a legacy trigger; migrating the trigger without the bump would call flags the pinned engine doesn't have. So they land together.

Workflow changes

  • Trigger: pull_request: [closed] → schedule (17 7 * * *, off-peak/off-:00) + workflow_dispatch with string since / window-hours recovery inputs (string, not number — a number-typed dispatch input fails the whole run at startup when the workflow also triggers on schedule).
  • Drop the "Gather merged-PR context" step — obsolete; the engine now gathers per-PR context over the window (gather_pr_context).
  • Invocation: retrospective --repo-dir "$GITHUB_WORKSPACE" --window-hours "$WINDOW_HOURS", appending --since only when non-empty.
  • Add actions: read — Track B lists engineer-bot author runs + downloads their logs via the App token; without this scope the step 403s and fails the whole run.
  • Fixed concurrency.group (no PR number on a scheduled run).

Config changes

  • Close the loop: add author.knowledge_log: .claude/knowledge/learning-log.md, matching retrospective.log_path. The retrospective writes that path; the author phase only reads it back when the two agree — so fixes benefit from what's been learned. It was previously half-open (learnings written, never read back).
  • Remove the now-dead retrospective.context_files key (the windowed sweep ignores it) and refresh the block comments.

Validation

  • Both YAML files parse; author.knowledge_log == retrospective.log_path (verified); no lingering github.event.pull_request.* in active logic; trigger/inputs shape matches the engine's own engineer-bot-learning-cron.yml.
  • The schedule registers only once this lands on the default branch. Before the first cron, the flow can be exercised via a manual workflow_dispatch with a recent since — it should open/update the rolling ai/learning-pr-* PR.

This pull request and its description were written by Isaac.

… bump engine

The engine's retrospective flow moved from a per-PR, on-merge, label-gated model
to a daily cron + adaptive-cursor window sweep. This repo was still on the legacy
shape end to end. Migrate it, and bump the engine pin so the new invocation
matches the engine it runs against.

- bot-prelude: bump engine-ref 92b3857 -> 654a31d0 (engine main; 61 commits). The
  locked SDK/CLI (0.2.102 / 2.1.61) are unchanged at that SHA, so this is a
  SHA-only bump — no install-bot-engine edit needed.

- engineer-bot-learning.yml: replace `pull_request: [closed]` (gated on
  merged + `extract-learning`) with `schedule` (07:17 UTC, off-peak/off-:00) +
  `workflow_dispatch` (string `since` / `window-hours` recovery inputs). Drop the
  now-obsolete "Gather merged-PR context" step — the modern retrospective gathers
  each PR's diff/comments itself over the window (gather_pr_context). Invoke with
  `--window-hours` (and `--since` when non-empty). Add `actions: read` (Track B
  lists author runs + downloads their logs via the App token; without it the run
  403s and fails). Fixed concurrency group (no PR number on a scheduled run).

- .bot/config.yaml: close the loop — add `author.knowledge_log` matching
  `retrospective.log_path` (.claude/knowledge/learning-log.md), so the author
  phase reads back what the retrospective learns. Remove the dead
  `retrospective.context_files` key (the windowed sweep ignores it) and refresh
  the block comments to describe the multi-PR window model.

The schedule registers only once this lands on the default branch; the flow can
be validated before the first cron via a manual workflow_dispatch with a recent
`since`.

Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>

@oss-reviewer-bot oss-reviewer-bot 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.

✅ No issues identified by the review bot.

…t form

The learning workflow set MODEL_ENDPOINT to
`.../serving-endpoints/anthropic/invocations`. That is NOT translated the way the
old comment claimed: sdk_agent.translate_endpoint has an early-return for URLs
already containing `/serving-endpoints/anthropic`, which keeps the trailing
`/invocations` — so the CLI appends `/v1/messages` and calls
`.../serving-endpoints/anthropic/invocations/v1/messages`, which the gateway
rejects with `400 Unsupported native API path`.

Proof: databricks-sql-python's learning cron (same endpoint form) has failed
every scheduled run with exactly this 400. The reviewer-bot flagged it on the
sibling PRs (Low), and it is the real cause.

Use the concrete `.../serving-endpoints/databricks-claude-opus-4-8/invocations`
form that reviewer-bot.yml / engineer-bot.yml already use successfully:
translate_endpoint strips `<model>/invocations` to the `.../serving-endpoints/
anthropic` base the CLI needs. Comment corrected to explain the trap.

Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>

@oss-reviewer-bot oss-reviewer-bot 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.

✅ No issues identified by the review bot.

@eric-wang-1990
eric-wang-1990 added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 4667deb Aug 13, 2026
15 checks passed

This branch was previously deployed

1 inactive deployment
azure-prod — 21b31d35 Deployed Aug 13, 2026 by eric-wang-1990 via review #150
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