Skip to content

chore(flue-review): switch reviewer to GLM-5.2 with reduced reasoning#2014

Merged
ascorbic merged 1 commit into
mainfrom
chore/flue-review-glm-5.2
Jul 13, 2026
Merged

chore(flue-review): switch reviewer to GLM-5.2 with reduced reasoning#2014
ascorbic merged 1 commit into
mainfrom
chore/flue-review-glm-5.2

Conversation

@ascorbic

Copy link
Copy Markdown
Collaborator

What does this PR do?

Switches the @emdashbot PR reviewer from kimi-k2.7-code to Workers AI's @cf/zai-org/glm-5.2, caps its reasoning effort at "low" so it stops over-deliberating on straightforward diffs, and raises the per-attempt review timeout from 20 to 30 minutes.

Getting there required a framework bump. glm-5.2 only carries the metadata flue needs (reasoning support + context window) in pi-ai 0.80.x, which is first pulled by @flue/runtime/@flue/cli 1.0.0-beta.9 (up from beta.1). On the pinned beta.1 catalog glm-5.2 resolves to zero metadata, so reasoning_effort is never sent and thinkingLevel is a silent no-op. beta.9 removed the old FlueContext / createAgent<Payload, Env> / export function run(ctx) workflow model, so .flue/workflows/review.ts is migrated to defineAgent + defineWorkflow:

  • The agent holds the model, thinkingLevel: "low", and the cf-shell sandbox (built from env in the initializer).
  • The Action run performs PR hydration (git clone) and GitHub posting. Since ActionContext deliberately omits platform bindings, it reads env back through getCloudflareContext() and keys the durable Workspace on the per-run Durable Object id, so the sandbox and the clone share the same DO SQLite + R2 spill prefix.

No functional change to the review protocol, schema, or GitHub posting path.

Rollout note (please verify before/right after merge): GLM-5.2's tool-calling and structured-output behavior on the Workers AI binding is not something the compiler or a local build can check. Recommend a one-PR end-to-end smoke test against @cf/zai-org/glm-5.2 to confirm it emits schema-conformant code-tool calls and honors reasoning_effort. If reasoning is unsupported, thinkingLevel is silently ignored (acceptable), but confirm it does not error.

Closes #

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes (flue-review)
  • pnpm lint passes — flue-review is lint-clean; the ~65 repo-wide --type-aware diagnostics are pre-existing baseline in unrelated packages, none in this change
  • pnpm test passes — n/a, this infra worker has no test suite (typecheck only); verified via flue build + an independent cross-model review of the migration
  • pnpm format has been run (oxfmt clean)
  • I have added/updated tests for my changes — n/a (no test harness for this worker)
  • User-visible strings in the admin UI are wrapped for translation — n/a (no admin UI strings)
  • I have added a changeset — n/a (@emdash-cms/flue-review is private and unpublished)
  • New features link to an approved Discussion — n/a (not a feature)

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.8 (authoring), independently reviewed with the Sonnet-family review agent

Screenshots / test output

pnpm typecheck, flue build --target cloudflare, oxfmt --check, and oxlint all pass for infra/flue-review.

Move the PR review bot from kimi-k2.7-code to Workers AI's
@cf/zai-org/glm-5.2 and cap its reasoning effort at "low" so it stops
over-deliberating on straightforward diffs. Bump the per-attempt review
timeout from 20 to 30 minutes.

GLM-5.2 only carries the metadata flue needs (reasoning support, context
window) in pi-ai 0.80.x, which requires @flue/runtime and @flue/cli
1.0.0-beta.9. That release removed the FlueContext/createAgent<Payload,Env>
workflow model, so review.ts is migrated to defineAgent + defineWorkflow:
the agent holds the model, thinkingLevel, and cf-shell sandbox, while the
Action's run performs PR hydration and GitHub posting, reading bindings
back through getCloudflareContext() and keying the Workspace on the
per-run Durable Object id.
Copilot AI review requested due to automatic review settings July 13, 2026 11:38
@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 00d5f88

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 00d5f88 Jul 13 2026, 11:24 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-do 00d5f88 Jul 13 2026, 11:25 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 00d5f88 Jul 13 2026, 11:24 AM

@github-actions github-actions Bot added review/needs-review No maintainer or bot review yet size/L cla: signed labels Jul 13, 2026
@ascorbic ascorbic added the bot:review Trigger an emdashbot code review on this PR label Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the infra/flue-review Worker (the @emdashbot PR review orchestrator) to use Flue’s newer workflow model and switch the reviewer model to Workers AI @cf/zai-org/glm-5.2, with reduced reasoning effort to shorten deliberation on straightforward diffs.

Changes:

  • Bump @flue/runtime and @flue/cli from 1.0.0-beta.1 to 1.0.0-beta.9 (and corresponding lockfile updates, including pi-ai 0.80.x).
  • Migrate the review workflow to the Flue 1.0 API (defineAgent + defineWorkflow) and move PR hydration into the workflow Action.
  • Switch the reviewer model to cloudflare/@cf/zai-org/glm-5.2, set thinkingLevel: "low", and increase per-attempt review timeout to 30 minutes.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
pnpm-lock.yaml Locks the Flue/PI-AI dependency upgrades required for GLM-5.2 metadata support.
infra/flue-review/package.json Bumps @flue/runtime / @flue/cli to 1.0.0-beta.9 to match the new workflow model and model-metadata behavior.
infra/flue-review/.flue/workflows/review.ts Migrates to defineAgent/defineWorkflow, adds GLM-5.2 + thinkingLevel: "low", moves repo hydration into the Action, and increases timeout.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new

pkg-pr-new Bot commented Jul 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2014

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2014

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2014

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2014

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2014

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2014

emdash

npm i https://pkg.pr.new/emdash@2014

create-emdash

npm i https://pkg.pr.new/create-emdash@2014

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2014

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2014

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2014

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2014

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2014

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2014

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2014

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2014

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2014

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2014

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2014

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2014

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2014

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2014

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2014

commit: 00d5f88

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the right change for the stated goal. Switching the reviewer to a model that exposes reasoning_effort and bumping @flue/runtime/@flue/cli to the version that carries the necessary metadata is sound, and migrating review.ts to defineAgent + defineWorkflow is the idiomatic beta.9 pattern. The PR keeps the same security boundary (GitHub token and hydration live only in the trusted Action run), preserves idempotent cloning via the HYDRATED marker, keeps the review result schema unchanged, and raises the per-attempt timeout in a single place.

What I checked:

  • The new workflow file, package.json, and pnpm-lock.yaml diff.
  • Supporting files in infra/flue-review/.flue/ (app.ts, webhook.ts, sandboxes/cloudflare-shell.ts, lib/capacity.ts, lib/review-schema.ts).
  • The separate root .flue/ package, which intentionally stays on @flue/runtime@^0.11.1 and uses the old createAgent/FlueContext API; it is unaffected by this scoped infra-only bump.

Headline: no logic bug or regression found in the migration. pnpm typecheck, flue build --target cloudflare, and formatting/linting pass for infra/flue-review per the author, and nothing in the static diff contradicts that.

The only things I cannot verify statically are:

  1. The model behavior called out in the rollout note (@cf/zai-org/glm-5.2 honoring reasoning_effort / thinkingLevel without error). The PR already asks for an end-to-end smoke test; please do that before/after merge.
  2. Whether getDurableObjectIdentity() inside the defineAgent factory is evaluated in the same per-run Durable Object context as the Action run. The comment documents that assumption, and the two call sites use the identical derivation, so it is consistent; I could not confirm the runtime timing.

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Jul 13, 2026
@ascorbic ascorbic merged commit e8e8a2d into main Jul 13, 2026
48 of 49 checks passed
@ascorbic ascorbic deleted the chore/flue-review-glm-5.2 branch July 13, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:review Trigger an emdashbot code review on this PR cla: signed review/awaiting-author Reviewed; waiting on the author to respond size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants