Repository navigation
fix: a queued message being edited waits until you save or cancel #10
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.
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
base: main
Are you sure you want to change the base?
Changes from all commits
9bee0e9
6cd61c6
1172481
3579040
7aa929f
e6e2c97
0d6e883
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,9 +138,20 @@ export const OrchestrationEffectRequestV2 = Schema.Union([ | |
| type: Schema.Literal("delegated-tasks.stop"), | ||
| reason: Schema.optional(Schema.String), | ||
| }), | ||
| Schema.Struct({ | ||
| type: Schema.Literal("queued-run.hold.expire"), | ||
| runId: RunId, | ||
| heldUntil: Schema.DateTimeUtcFromString, | ||
| }), | ||
| ]); | ||
| export type OrchestrationEffectRequestV2 = typeof OrchestrationEffectRequestV2.Type; | ||
|
|
||
| // These wait only on their own kind, so one due in minutes cannot hold back a thread's turns. | ||
| const OWN_LANE_EFFECT_TYPES = [ | ||
| "thread-title.generate", | ||
| "queued-run.hold.expire", | ||
| ] as const satisfies ReadonlyArray<OrchestrationEffectRequestV2["type"]>; | ||
|
|
||
| export const REPLAY_SAFE_EFFECT_TYPES_AFTER_PROCESS_LOSS = [ | ||
| "provider-runtime.continue", | ||
| "provider-session.detach", | ||
|
|
@@ -152,6 +163,7 @@ export const REPLAY_SAFE_EFFECT_TYPES_AFTER_PROCESS_LOSS = [ | |
| "attachment.cleanup", | ||
| "thread-title.generate", | ||
| "delegated-tasks.stop", | ||
| "queued-run.hold.expire", | ||
| ] as const satisfies ReadonlyArray<OrchestrationEffectRequestV2["type"]>; | ||
|
|
||
| export const PROCESS_BOUND_EFFECT_TYPES = [ | ||
|
|
@@ -339,6 +351,10 @@ export const layer: Layer.Layer<EffectOutboxV2, never, SqlClient.SqlClient> = La | |
| available, | ||
| Array.from({ length: Math.min(64, Math.max(0, Math.floor(count))) }, () => undefined), | ||
| ).pipe(Effect.asVoid); | ||
| const effectLane = (alias: "candidate" | "active") => | ||
| sql.literal( | ||
| `CASE WHEN ${alias}.effect_type IN (${OWN_LANE_EFFECT_TYPES.map((type) => `'${type}'`).join(", ")}) THEN ${alias}.effect_type ELSE '' END`, | ||
| ); | ||
| // Retry backoff must block later effects so turns cannot race a pending rollback. | ||
| const claimableCandidatePredicate = ( | ||
| availableBefore?: string, | ||
|
|
@@ -368,17 +384,7 @@ export const layer: Layer.Layer<EffectOutboxV2, never, SqlClient.SqlClient> = La | |
| } | ||
| ) | ||
| ) | ||
| AND ( | ||
| ( | ||
| candidate.effect_type = 'thread-title.generate' | ||
| AND active.effect_type = 'thread-title.generate' | ||
| ) | ||
| OR | ||
| ( | ||
| candidate.effect_type != 'thread-title.generate' | ||
| AND active.effect_type != 'thread-title.generate' | ||
| ) | ||
| ) | ||
| AND ${effectLane("candidate")} = ${effectLane("active")} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note 🤖 Claude Opus 5.5 responding on behalf of jagrat7 Not changing this. It needs two different messages on one thread to be held at the same time (two devices, two messages), and the cost is only a late expiry, bounded by the other hold's deadline. Giving each run its own lane would put a JSON read into every outbox claim, which is a hot path. |
||
| ) | ||
| AND ${ | ||
| maxRunningTitleGenerations === undefined | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Real-client edit lifecycle remains unverified
The
ThreadQueueSheetcloses immediately after opening an edit. The PR lists no real-client pass or base/head scenario proof, both required by verification guidance.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note
🤖 Claude Opus 5.5 responding on behalf of jagrat7
Agreed that a real-client pass is still owed; the PR description says so. The maintainer is checking it by hand in a dev build. The sheet closing after Edit is existing behavior:
navigation.goBack()afterbeginQueuedRunEditwas already there, and the edit continues in the thread composer.