chore(flue-review): switch reviewer to GLM-5.2 with reduced reasoning#2014
Conversation
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.
|
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | 00d5f88 | Jul 13 2026, 11:24 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | 00d5f88 | Jul 13 2026, 11:25 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | 00d5f88 | Jul 13 2026, 11:24 AM |
There was a problem hiding this comment.
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/runtimeand@flue/clifrom1.0.0-beta.1to1.0.0-beta.9(and corresponding lockfile updates, includingpi-ai0.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, setthinkingLevel: "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.
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/auth-atproto
@emdash-cms/blocks
@emdash-cms/cloudflare
@emdash-cms/contentful-to-portable-text
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/plugin-cli
@emdash-cms/plugin-types
@emdash-cms/registry-client
@emdash-cms/registry-lexicons
@emdash-cms/sandbox-workerd
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-field-kit
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
There was a problem hiding this comment.
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, andpnpm-lock.yamldiff. - 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.1and uses the oldcreateAgent/FlueContextAPI; 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:
- The model behavior called out in the rollout note (
@cf/zai-org/glm-5.2honoringreasoning_effort/thinkingLevelwithout error). The PR already asks for an end-to-end smoke test; please do that before/after merge. - Whether
getDurableObjectIdentity()inside thedefineAgentfactory is evaluated in the same per-run Durable Object context as the Actionrun. 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.
What does this PR do?
Switches the
@emdashbotPR reviewer fromkimi-k2.7-codeto 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.2only carries the metadata flue needs (reasoning support + context window) inpi-ai 0.80.x, which is first pulled by@flue/runtime/@flue/cli1.0.0-beta.9(up frombeta.1). On the pinnedbeta.1catalogglm-5.2resolves to zero metadata, soreasoning_effortis never sent andthinkingLevelis a silent no-op. beta.9 removed the oldFlueContext/createAgent<Payload, Env>/export function run(ctx)workflow model, so.flue/workflows/review.tsis migrated todefineAgent+defineWorkflow:thinkingLevel: "low", and the cf-shell sandbox (built fromenvin the initializer).runperforms PR hydration (git clone) and GitHub posting. SinceActionContextdeliberately omits platform bindings, it readsenvback throughgetCloudflareContext()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.2to confirm it emits schema-conformantcode-tool calls and honorsreasoning_effort. If reasoning is unsupported,thinkingLevelis silently ignored (acceptable), but confirm it does not error.Closes #
Type of change
Checklist
pnpm typecheckpasses (flue-review)pnpm lintpasses — flue-review is lint-clean; the ~65 repo-wide--type-awarediagnostics are pre-existing baseline in unrelated packages, none in this changepnpm testpasses — n/a, this infra worker has no test suite (typecheckonly); verified viaflue build+ an independent cross-model review of the migrationpnpm formathas been run (oxfmt clean)@emdash-cms/flue-reviewis private and unpublished)AI-generated code disclosure
Screenshots / test output
pnpm typecheck,flue build --target cloudflare,oxfmt --check, andoxlintall pass forinfra/flue-review.