GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): snooze no longer waits two minutes after a steered queued message by juliusmarminge · Pull Request #35661 · pingdotgg/t3code

fix(server): snooze no longer waits two minutes after a steered queued message #35661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
juliusmarminge merged 5 commits into main from factory/issue-23778-a23787
Nov 12, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(server): snooze no longer waits two minutes after a steered queued message #35661

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
d1545ee
test(server): a steered queued run that never started is not the shel…
juliusmarminge Nov 12, 2026
29ac4dc
fix(server): snooze no longer waits two minutes after a steered queue…
juliusmarminge Nov 12, 2026
761c8b7
fix(server): keep a removed queued run latest when the earlier run al…
juliusmarminge Nov 12, 2026
c351030
fix(server): silent compaction runs no longer hide a removed queued r…
juliusmarminge Nov 12, 2026
5197429
Merge branch 'main' into factory/issue-23778-a23787
juliusmarminge Nov 12, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(server): snooze no longer waits two minutes after a steered queue…
…d message

Steering a queued message into the running turn cancels its queued run
before it starts. The shell still presented that never-started run as the
thread's latest run, so its old timestamps read as a pending turn start
and Snooze stayed disabled until the queued-start grace window ran out.

latestUnheldRun and its SQL mirror presentedShellRunId now skip cancelled
runs that never started, so the run that actually ran presents.

AI-assisted; verified with the tests and tools listed above.
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge committed Nov 12, 2026
commit 29ac4dc934d6ab6192e9e83abd821967be12b1d4

There are no files selected for viewing

12 changes: 9 additions & 3 deletions 12 apps/server/src/orchestration-v2/ProjectionStore.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5039,8 +5039,7 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
),
);

// A steer cancels the queued run before it starts while the steered run keeps writing, so
// the queued message leaves the window but its run is still the shell's latest run.
// A steer moves the cancelled queued message outside the window.
const steeredItemId = "turn-item:bounded-sql-history:steered-output";
const steeredRunId = RunId.make("run:bounded-sql-history:1000");
yield* sql`
Expand Down Expand Up @@ -5078,7 +5077,14 @@ it.layer(layerTest)("ProjectionStoreV2", (it) => {
assert.isFalse(
steeredSnapshot.projection.turnItems.some((item) => item.runId === cancelledRunId),
);
assert.isTrue(steeredSnapshot.projection.runs.some((run) => run.id === cancelledRunId));
const latestRunId = (yield* projectionStore.getShellSnapshot()).threads.find(
(thread) => thread.id === threadId,
)?.latestRunId;
assert.equal(latestRunId, hiddenRunId);
assert.isFalse(
steeredSnapshot.projection.turnItems.some((item) => item.runId === latestRunId),
);
assert.isTrue(steeredSnapshot.projection.runs.some((run) => run.id === latestRunId));
yield* sql`DELETE FROM orchestration_v2_projection_turn_items WHERE turn_item_id = ${steeredItemId}`;

const interruptRunId = RunId.make("run:bounded-sql-history:interrupt");
Expand Down
8 changes: 6 additions & 2 deletions 8 apps/server/src/orchestration-v2/ProjectionStore.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3784,7 +3784,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
OR run_id IN (SELECT value FROM json_each(${cohortRunIds}))
OR run_id = ${window.requiredRunId ?? null}
${
// The shell's latest run, even a steer-cancelled one outside the newest window.
// Keep the shell's latest run even when its items are outside the newest window.
window.anchorItemId === undefined && window.requiredRunId === undefined
? sql`OR run_id = ${presentedShellRunId(sql`${threadId}`)}`
: sql``
Expand Down Expand Up @@ -7435,7 +7435,7 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
)
)`;
};
// The newest run not waiting in a held queue, matching latestUnheldRun.
// The newest run not held or removed before it started, matching latestUnheldRun.
const presentedShellRunId = (threadId: Statement.Fragment) => sql`(
SELECT candidate.run_id
FROM orchestration_v2_projection_runs candidate
Expand All @@ -7444,6 +7444,10 @@ export const layer: Layer.Layer<ProjectionStoreV2, never, SqlClient.SqlClient> =
candidate.status = 'queued'
AND json_extract(candidate.payload_json, '$.queueHeld') IS 1
)
AND NOT (
candidate.status = 'cancelled'
AND json_extract(candidate.payload_json, '$.startedAt') IS NULL
)
AND NOT ${isSilentShellRun("candidate")}
ORDER BY candidate.ordinal DESC, candidate.run_id DESC
LIMIT 1
Expand Down
5 changes: 3 additions & 2 deletions 5 ...erver/src/orchestration-v2/testkit/fixtures/queued_cancelled_while_active/codex_output.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export function assertQueuedCancelledWhileActiveOutput(
.get(ACTIVE_RUN_SHELL_SNAPSHOT_KEY)
?.threads.find((thread) => thread.id === projection.thread.id);
assert.isDefined(capturedShell);
assert.equal(capturedShell.latestRunId, cancelledRun.id);
assert.equal(capturedShell.status, "cancelled");
// The cancelled queued run never started, so the active run presents as the latest.
assert.equal(capturedShell.latestRunId, activeRun.id);
assert.equal(capturedShell.status, "running");
assert.equal(capturedShell.activeRunId, activeRun.id);
assert.equal(capturedShell.activityRunStatus, "running");
assert.deepEqual(
Expand Down
2 changes: 2 additions & 0 deletions 2 packages/shared/src/orchestrationV2ThreadError.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ export function latestUnheldRun(
let latest: OrchestrationV2Run | null = null;
for (const run of runs) {
if (run.status === "queued" && run.queueHeld === true) continue;
// A removed or steered queued message leaves a cancelled run that never started.
if (run.status === "cancelled" && run.startedAt === null) continue;
if (latest === null || run.ordinal > latest.ordinal) latest = run;
}
return latest;
Expand Down
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.
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.