Skip to content

chore(emdash-bot): port to Flue 2.0.3 with Workers traces (bot next-gen 1/5) - #2375

Merged
ascorbic merged 9 commits into
mainfrom
bot-nextgen/01-flue2-skeleton
Aug 9, 2026
Merged

chore(emdash-bot): port to Flue 2.0.3 with Workers traces (bot next-gen 1/5)#2375
ascorbic merged 9 commits into
mainfrom
bot-nextgen/01-flue2-skeleton

Conversation

@ascorbic

@ascorbic ascorbic commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Slice 1 of the bot next-gen stack (design: maintainer-triggered triage/repro bot replacing the Actions-driven gen-1 pipeline). This slice is a pure framework port with no behavior redesign: infra/emdash-bot moves from @flue 0.4-nightly to Flue 2.0.3, with Workers trace collection enabled.

  • Deps: @flue/runtime + @flue/vite → 2.0.3; agents → ^0.20.1 (aligned with what @flue/vite bundles). Root pnpm-workspace.yaml: drops the two now-dead nightly minimumReleaseAgeExclude pins and repoints the @flue/runtime>hono override to 2.0.3. Lockfile changes are confined to the two private infra/* importers plus one catalog drift-correction; no published package's resolved tree changes.
  • Flue 2 API port (all mechanical): tool run() returns { output } envelopes; dispatch() now resolves on admission so the classifier does dispatch() + read(receipt) under a single shared 10s budget (admission stall now rejects instead of hanging past GitHub's webhook ack window); DispatchReceipt.submissionId rename; FlueEvent drops dispatchId; withSandboxDeadlines rewritten onto the new createSandbox factory method — under Flue 2 the old createSessionEnv wrapper would have been silently bypassed, so this closes a latent deadline hole.
  • DO migrations: none needed — verified against the generated deploy config that Flue 2's Flue<Pascal>Agent naming produces class names byte-identical to the existing migration v3. Migrations block untouched.
  • Traces: observability.traces.enabled in wrangler + explicit instrument(createCloudflareTracing()) at app-entry module scope (content-on; public data). Verified against the built runtime that the generated entry's default installer sees the existing instrumentation and no-ops — no double-install.

Groundwork for the stack: slice 2 (state-machine trigger/fix-loop states), slice 3 (@cloudflare/computer execution layer), slice 4 (pkg.pr.new fix loop), slice 5 (evals + Actions cutover).

Closes #

Type of change

  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes — n/a-with-note: infra/emdash-bot is not in any typecheck gate and has a pre-existing red state (68 errors from unresolvable DO generics; files byte-identical to main). The port introduces zero new errors; every error the upgrade caused was fixed.
  • pnpm lint passes — oxlint --type-aware clean on all changed files
  • pnpm test passes — emdash-bot unit 83/83, integration 29/29 (workers pool)
  • pnpm format has been run — oxfmt no-op (already tab-correct)
  • I have added/updated tests for my changes — test plumbing updated for the new APIs only; no assertion weakened
  • User-visible strings in the admin UI are wrapped for translation — n/a
  • I have added a changeset — n/a, infra/emdash-bot is not a published package
  • New features link to an approved Discussion — n/a, chore/port

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Fable 5 (Claude Code; built and adversarially reviewed by Fable subagents)

Screenshots / test output

unit:        83 passed (83)
integration: 29 passed (29)   # CLOUDFLARE_ACCOUNT_ID exported for workers pool

Try this PR

Open a fresh playground →

A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.

Tracks bot-nextgen/01-flue2-skeleton. Updated automatically when the playground redeploys.

@changeset-bot

changeset-bot Bot commented Aug 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: aecf8b7

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

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 756 lines across 13 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@ascorbic ascorbic changed the title bot nextgen/01 flue2 skeleton chore(emdash-bot): port to Flue 2.0.3 with Workers traces (bot next-gen 1/5) Aug 8, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

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 aecf8b7 Aug 09 2026, 08:35 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

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 2578317 Aug 09 2026, 07:19 AM

@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

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

@emdash-cms/auth

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

@emdash-cms/auth-atproto

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

@emdash-cms/blocks

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

@emdash-cms/cloudflare

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

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

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

emdash

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

create-emdash

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

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

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

@emdash-cms/plugin-cli

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

@emdash-cms/plugin-types

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

@emdash-cms/registry-client

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

@emdash-cms/registry-lexicons

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

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2375

@emdash-cms/sandbox-workerd

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

@emdash-cms/x402

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

@emdash-cms/plugin-ai-moderation

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

@emdash-cms/plugin-atproto

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

@emdash-cms/plugin-audit-log

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

@emdash-cms/plugin-color

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

@emdash-cms/plugin-embeds

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

@emdash-cms/plugin-field-kit

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

@emdash-cms/plugin-forms

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

@emdash-cms/plugin-webhook-notifier

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

commit: aecf8b7

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

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 aecf8b7 Aug 09 2026, 08:34 AM

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

Ports infra/emdash-bot from the Flue 0.4 nightly line to Flue 2.0.3, updates the bot’s generated Flue glue code to the Flue 2 APIs (notably { output } tool envelopes and dispatch receipt field changes), and enables Workers trace collection.

Changes:

  • Upgrade @flue/runtime / @flue/vite to 2.0.3 and align agents to ^0.20.1, including workspace overrides/lockfile updates.
  • Update Flue 2 API call sites (createSandbox, { output } return envelopes, submissionId receipt field) and adjust classifier dispatch/read timing behavior.
  • Enable Cloudflare Workers traces via wrangler.jsonc and add explicit Flue tracing instrumentation at app entry.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Removes nightly pin exclusions and updates the Flue→Hono override to the 2.0.3 selector.
pnpm-lock.yaml Lockfile refresh reflecting Flue 2.0.3 + agents upgrade and related dependency graph changes.
infra/emdash-bot/wrangler.jsonc Enables Workers observability traces collection.
infra/emdash-bot/vitest.workers.config.ts Increases integration test timeout to accommodate remote-proxy warmup.
infra/emdash-bot/tests/unit/sandbox-deadline.test.ts Updates tests for createSandbox() API rename.
infra/emdash-bot/package.json Updates Flue and agents dependency pins to the Flue 2 stack.
infra/emdash-bot/.flue/lib/sandbox-deadline.ts Ports factory hook from createSessionEnv to createSandbox.
infra/emdash-bot/.flue/lib/orchestrator.ts Updates receipt field use from dispatchId to submissionId.
infra/emdash-bot/.flue/lib/observer.ts Removes deprecated dispatchId correlation fallback.
infra/emdash-bot/.flue/lib/classifier-client.ts Refactors classifier dispatch/read flow for Flue 2 admission semantics + shared timeout budget.
infra/emdash-bot/.flue/app.ts Installs Cloudflare tracing instrumentation at module scope.
infra/emdash-bot/.flue/agents/investigate.ts Updates tool return to Flue 2 { output } envelope.
infra/emdash-bot/.flue/agents/classify-command.ts Updates tool return to Flue 2 { output } envelope.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +40 to 45
async createSandbox(context) {
const env = await withDeadline(
factory.createSessionEnv(context),
factory.createSandbox(context),
options.defaultTimeoutMs,
"Sandbox session creation",
);
Comment on lines 74 to 76
} catch (err) {
return { kind: "error", error: errorMessage(err) };
}
Comment thread infra/emdash-bot/.flue/app.ts Outdated
Comment on lines +25 to +27
// Module scope: registers before (and overrides) Flue's default tracing install.
// Omitting `content` captures payloads; `content: false` would drop them.
instrument(createCloudflareTracing());
@ascorbic ascorbic added bot:review Trigger an emdashbot code review on this PR and removed bot:review Trigger an emdashbot code review on this PR labels Aug 8, 2026
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 8, 2026
@ascorbic ascorbic added the bot:review Trigger an emdashbot code review on this PR label Aug 8, 2026
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Overlapping PRs

This PR modifies files that are also changed by other open PRs:

This may cause merge conflicts or duplicated work. A maintainer will coordinate.

@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 Aug 8, 2026
@ascorbic ascorbic added bot:review Trigger an emdashbot code review on this PR and removed bot:review Trigger an emdashbot code review on this PR labels Aug 8, 2026
@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 9, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 9, 2026

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
docs a360854 Aug 09 2026, 06:34 AM

@ascorbic ascorbic added the bot:review Trigger an emdashbot code review on this PR label Aug 9, 2026

@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 scope for a skeleton slice: a pure, mechanical Flue 2.0.3 framework port of the private infra/emdash-bot package with no behavior redesign. The diff stays inside the bot package, pnpm-workspace.yaml, and the lockfile; no published packages, admin UI, SQL, or logged-out routes change. The API renames (dispatchIdsubmissionId, createSessionEnvcreateSandbox), the { output } tool-return envelopes, and the new init()/dispatch()/read() classifier flow all match the stated Flue 2 contract. I found no blocking bugs or regressions.

Re-review status: the previous review's classifier dispatch-path coverage gap is now filled in (dispatch stall, budget exhaustion, rejected read), so that suggestion is resolved. The shared-timeout robustness concern is still present. New in this pass are AGENTS.md comment-discipline violations in the changed files and a low-confidence note that Flue 2 may have made useDataWriter async, in which case the agent write calls need await.

Headline: clean mechanical port, but trim the narrative comments and verify the writer calls and classifier deadline before merging.


Findings

  • [suggestion] infra/emdash-bot/.flue/app.ts:24-25

    The added module-scope comments explain and justify the tracing design ("registers before and overrides Flue's default tracing install", "Omitting content captures payloads"). AGENTS.md says comments should not justify decisions or narrate design rationale; that context belongs in the commit message / PR description. The code itself already expresses what happens, so these lines can be removed.

    import { Investigate } from "./agents/investigate.js";
    import { installAgentObserver } from "./lib/observer.js";
    import { registerCoreRoutes } from "./routes.js";
    
    instrument(createCloudflareTracing());
    installAgentObserver();
    
  • [suggestion] infra/emdash-bot/.flue/lib/classifier-client.ts:44-46

    This comment both justifies the design and references a "GitHub's webhook ack window" motivation that does not match the current architecture: the webhook handler (routes.ts) returns 202 immediately after enqueueing the DO, and classification runs inside the DO alarm. AGENTS.md disallows comments that justify decisions or narrate rationale. The shared-deadline code that follows is self-explanatory, so the comment can be deleted.

    		const handle = init(ClassifyCommand, {
    			id: `classify-${crypto.randomUUID()}`,
    			uid: null,
    		});
    		const deadline = Date.now() + CLASSIFY_TIMEOUT_MS;
    		const receipt = await withDeadline(
    
  • [suggestion] infra/emdash-bot/wrangler.jsonc:90-91

    The added comment explains why traces.enabled is set. AGENTS.md disallows comments that justify decisions or narrate design rationale; the flag name and value are self-explanatory and the surrounding PR description already documents the Flue 2 tracing contract.

    
    	"observability": {
    		"enabled": true,
    		"traces": {
    			"enabled": true,
    
  • [suggestion] infra/emdash-bot/vitest.workers.config.ts:48-49

    The added comment explains/justifies the testTimeout bump. AGENTS.md disallows comments that justify decisions; the timeout value is a configuration knob and the rationale belongs in the PR description.

    	test: {
    		include: ["tests/integration/**/*.test.ts"],
    		testTimeout: 20_000,
    	},
    
  • [suggestion] infra/emdash-bot/.flue/lib/classifier-client.ts:47-71

    classifyComment splits the 10 s budget between admission and read using Date.now(). Wall-clock time can jump backwards or forwards, so the remaining budget can be larger or smaller than actually elapsed. When dispatch() returns with a tiny positive remainder, handle.read(..., AbortSignal.timeout(remainingMs)) will almost certainly abort immediately. Consider using a single monotonic budget around the whole dispatch + read sequence if Flue's API allows it, or at least a monotonic deadline source such as performance.now().

  • [suggestion] infra/emdash-bot/.flue/agents/classify-command.ts:66

    writeResult(classification) is called in an async tool run() without await. If Flue 2's useDataWriter returns a Promise (which is typical for durable writes), the tool step may settle before the data is persisted and rejections become unhandled. The same pattern appears at line 89. Verify the return type; if it is async, await these calls.

    				setResult(classification);
    				await writeResult(classification);
    				return { output: classification };
    
  • [suggestion] infra/emdash-bot/.flue/agents/investigate.ts:120

    writeResult(reportedResult) is called in the durable tool report_result without await. The useAgentStart and useAgentFinish callbacks do the same at lines 99 and 151. If Flue 2's useDataWriter returns a Promise, the step may complete before the data is persisted and rejections become unhandled. Verify the return type; if it is async, await all three write calls.

    				const reportedResult = { result: data, ok: true, pushed };
    				await writeResult(reportedResult);
    				setReported(true);
    

@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 9, 2026
@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview Author pushed changes since the last review labels Aug 9, 2026
@ascorbic
ascorbic force-pushed the bot-nextgen/01-flue2-skeleton branch from a360854 to 2578317 Compare August 9, 2026 07:16
@ascorbic

ascorbic commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Round-2 items addressed: the classifier budget now uses performance.now() end to end (with the read failing deterministically when dispatch consumes it), and the flagged rationale comments in app.ts, classifier-client.ts, wrangler.jsonc, and vitest.workers.config.ts are trimmed — the classifier one was indeed stale about the webhook ack window.

The writeResult findings are not applicable: Flue 2's useDataWriter returns a synchronous write-only streamer ((data) => void), not a Promise — there is nothing to await at any of the three call sites.

~ 🤖 Claude Fable 5

@ascorbic ascorbic added the bot:review Trigger an emdashbot code review on this PR label Aug 9, 2026
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Aug 9, 2026

@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 remains the right scope for the skeleton slice: a purely mechanical Flue 2.0.3 port of infra/emdash-bot with no behavior redesign. The renames (dispatchIdsubmissionId, createSessionEnvcreateSandbox), the { output } tool-return envelopes, and the new dispatch()/read() classifier flow all line up with the Flue 2 contract.

I re-read the changed files, the new classifier-client tests, and the lockfile diff. No logic regressions or security issues jumped out. The classifier-client shared-timeout concern from the prior pass is now addressed: it uses performance.now() instead of wall-clock Date.now() and the dispatch/read split is covered by unit tests for admission stall, budget exhaustion, and rejected reads. The wrangler.jsonc and classifier-client comment-discipline notes from the prior review are also fixed.

What is still open from the prior pass:

  1. Two AGENTS.md comment-discipline violations remain in the current diff:
    • infra/emdash-bot/.flue/app.ts adds a comment that justifies the instrumentation ordering.
    • infra/emdash-bot/vitest.workers.config.ts adds a comment that justifies the testTimeout value.
  2. The potential useDataWriter async issue is still unaddressed and unverified in this pass. I still cannot confirm the Flue 2 return type without runnable typechecking or node_modules, but if useDataWriter returns a Promise then the unawaited writeResult calls in classify-command.ts and investigate.ts could settle the step before the durable write persists and turn rejections into unhandled failures.

All remaining findings are suggestions; none of them block merging the port itself.

One small side note: the lockfile diff is broader than the PR prose suggests — it drops tarball: URLs from many Cloudflare packages across the lockfile, not just the two infra/* importers. I don’t believe that changes the resolved tree, but you may want to confirm the pnpm version so the diff matches the stated intent.


Findings

  • [suggestion] infra/emdash-bot/.flue/app.ts:25

    The added comment justifies why instrument() needs to be at module scope and why it must precede Flue’s default tracing install. AGENTS.md allows comments for non-obvious ordering constraints, but the instrumentation call is already self-explanatory and the PR description already documents the Flue 2 tracing contract. The comment is reviewer-facing rationale rather than a footgun a future reader would otherwise miss.

    import { Investigate } from "./agents/investigate.js";
    import { installAgentObserver } from "./lib/observer.js";
    import { registerCoreRoutes } from "./routes.js";
    
    instrument(createCloudflareTracing());
    installAgentObserver();
    
  • [suggestion] infra/emdash-bot/vitest.workers.config.ts:46

    The added comment explains the timeout rationale (Below ~20s the first test flakes...). AGENTS.md says comments should not justify decisions; the testTimeout value is a configuration knob and its rationale belongs in the PR description, not in the config file.

    	test: {
    		include: ["tests/integration/**/*.test.ts"],
    		testTimeout: 20_000,
    	},
    
  • [suggestion] infra/emdash-bot/.flue/agents/classify-command.ts:42

    The writeResult calls at lines 66 and 89 are not awaited. The prior pass flagged this as a low-confidence concern, but it is still unaddressed and unverified in this pass. If Flue 2 made useDataWriter return a Promise for durable writes (the common pattern), the tool step may settle and the agent may finish before the data is persisted, and any rejection becomes an unhandled rejection.

    I cannot confirm the exact return type without runnable typechecking or inspectable @flue/runtime types, so please verify. If it is async, await both calls:

    // line 66
    			setResult(classification);
    			await writeResult(classification);
    			return { output: classification };
    
    // line 89
    		const fallback = { event: "none", arg: null, reasoning: "No clear command selected" };
    		setResult(fallback);
    		await writeResult(fallback);
    
  • [suggestion] infra/emdash-bot/.flue/agents/investigate.ts:76

    The writeResult calls at lines 99, 120, and 151 are also not awaited. As with classify-command.ts, if Flue 2’s useDataWriter is async, the agent step may complete before the durable result is persisted and rejections become unhandled failures.

    I cannot confirm this from the checked-out files alone, so please verify the Flue 2 return type. If it returns a Promise, await all three write calls:

    // line 99
    		const result = failedResult(
    			`I couldn't prepare the investigation sandbox: ${errorMessage(error)}`,
    		);
    		await applyInvestigationResult(input, result, false, false);
    		await writeResult({ result, ok: false, pushed: false });
    		setReported(true);
    		log.error("sandbox setup failed", { error: errorMessage(error) });
    
    // line 120
    			const reportedResult = { result: data, ok: true, pushed };
    			await writeResult(reportedResult);
    			setReported(true);
    			log.info("investigation reported", {
    
    // line 151
    		await applyInvestigationResult(input, result, false, false);
    		await writeResult({ result, ok: false, pushed: false });
    		setReported(true);
    		log.warn("agent stopped without reporting", { runId: input.runId });
    

@emdashbot emdashbot Bot removed the bot:review Trigger an emdashbot code review on this PR label Aug 9, 2026
@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-rereview Author pushed changes since the last review labels Aug 9, 2026
Move the bot off the reviewed Flue 2 nightly onto the 2.0.3 release, and
align its bundled agents SDK dep with what @flue/vite ships (0.20.1). The
workspace hono override and cooldown-exclude pins are updated to match; the
nightly excludes are dropped since 2.0.3 is past the release-age cooldown.
Flue 2.0.3 tightens several surfaces the bot uses:
- defineTool run() with an output schema must return { output } (envelope),
  not the bare value.
- init() handles split dispatch (returns a receipt) from read() (awaits the
  reply); the classifier now dispatches then reads with its timeout signal.
- DispatchReceipt.dispatchId is renamed submissionId.
- FlueEvent no longer carries dispatchId (observer drops it).
- SandboxFactory's primary method is createSandbox; createSessionEnv is
  deprecated, so withSandboxDeadlines must wrap createSandbox or the
  deadlines are silently bypassed. The unit test's mock follows suit.

Behavior is unchanged; these are mechanical adaptations to the new types.
Flue 2's generated Worker entry installs content-on Cloudflare tracing by
default; this flag activates collection on the account. Content is enabled
(issues/PRs are public), matching the design's diagnosable-by-default goal.
The AI binding forces the vitest workers pool onto a remote proxy; the first
test to run pays the connection warmup and intermittently overran the 5s
default. Raise to 20s so the suite is deterministic.
…pp entry

Register instrument(createCloudflareTracing()) at module scope so content
capture is explicit rather than relying on Flue's default install. Content is
on (public issue/PR data); the API expresses on/off as omit/false, with no
true literal.
…ut budget

The dispatch/read split left handle.dispatch() (which resolves only on
admission) with no deadline, so an admission stall would hang classifyComment
past GitHub's webhook ack window instead of erroring. Wrap dispatch in
withDeadline and share one budget with the read so admission + settlement stay
within the 10s envelope.

Also trims narrative from the traces comment in wrangler.jsonc.
@ascorbic
ascorbic force-pushed the bot-nextgen/01-flue2-skeleton branch from 2578317 to b6095ef Compare August 9, 2026 08:09
@github-actions github-actions Bot added review/needs-rereview Author pushed changes since the last review and removed review/awaiting-author Reviewed; waiting on the author to respond labels Aug 9, 2026
@ascorbic
ascorbic merged commit 473119a into main Aug 9, 2026
46 checks passed
@ascorbic
ascorbic deleted the bot-nextgen/01-flue2-skeleton branch August 9, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed overlap review/needs-rereview Author pushed changes since the last review size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants