Skip to content

feat(coderd/x/chatd): map edited-away executions into the cancel sweep - #27321

Closed
ibetitsmike wants to merge 1 commit into
mike/codagt-757/04-interrupt-mappingfrom
mike/codagt-757/05-execution-sweep
Closed

ibetitsmike wants to merge 1 commit into
mike/codagt-757/04-interrupt-mappingfrom
mike/codagt-757/05-execution-sweep

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Maps execution ledger rows into the cancel sweep when a history edit deletes the messages that carried their results.

Part 5/9 of the CODAGT-757 execution ledger stack (base: #4, interrupt mapping and sweep).

Changes

  • mapExecutionsForHistoryDelete marks unresolved executions whose tool results live in an edited-away suffix as cancel_requested (MarkChatToolCallExecutionsCancelRequestedForHistoryDelete), restarting their give-up clock, so the sweep from experiment: Frontend - Share v1 UI via coder/m submodule (Approach 1) #4 kills their processes instead of leaving them orphaned with no addressable handle.
  • Tx.EditMessage runs the mapping before soft-deleting the suffix, in the same transaction.
  • Detached background rows are mapped too: their spared handle lived in the deleted result, so nothing can re-attach to them after the edit.

This PR was authored by Mux, an AI coding agent, on Mike's behalf. The stack recomposes the previously reviewed #27100/#27102/#27103 into reviewable pieces, plus fixes from subsequent review rounds.

@linear-code

linear-code Bot commented Jul 17, 2026

Copy link
Copy Markdown

CODAGT-757

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae1b741ea8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/tasks.go
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from 048be89 to 19ea79b Compare July 17, 2026 18:59
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from ae1b741 to 9bb2557 Compare July 17, 2026 18:59
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9bb2557f0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/tasks.go
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from 19ea79b to a269eb8 Compare July 17, 2026 19:59
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from 9bb2557 to 7d87029 Compare July 17, 2026 19:59
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 7d87029f02

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78ace45ca4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/tasks.go Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from ae41ee2 to 8811cc5 Compare July 17, 2026 21:48
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from 78ace45 to 8074fdc Compare July 17, 2026 21:48
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8074fdc3f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/chatstate/transitions.go
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from 8811cc5 to c658051 Compare July 17, 2026 22:37
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from 8074fdc to 205b452 Compare July 17, 2026 22:37
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 205b4526a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from 205b452 to c0c96f9 Compare July 17, 2026 23:09
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from c658051 to 7e3d261 Compare July 17, 2026 23:09
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: d86b8eb8f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from 3333ef6 to 99f2e46 Compare July 18, 2026 00:44
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from d86b8eb to ca25790 Compare July 18, 2026 00:44
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: ca25790a16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from 99f2e46 to a5ed2ae Compare July 18, 2026 01:38
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from ca25790 to a5c7e47 Compare July 18, 2026 01:38
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: a5c7e47b3d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from a5ed2ae to e67ff2a Compare July 18, 2026 03:49
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from a5c7e47 to b5c637b Compare July 18, 2026 03:50
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: b5c637bf90

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06bcf14aa3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coderd/x/chatd/tasks.go Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from bd4d2ca to b7917b7 Compare July 18, 2026 04:57
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from 06bcf14 to 8564e68 Compare July 18, 2026 04:57
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 8564e68278

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/04-interrupt-mapping branch from b7917b7 to e4202b6 Compare July 18, 2026 05:57
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/05-execution-sweep branch from 8564e68 to 163aad2 Compare July 18, 2026 05:57
@ibetitsmike ibetitsmike changed the title feat(coderd/x/chatd): sweep stalled execution cancels and map edited-away executions feat(coderd/x/chatd): map edited-away executions into the cancel sweep Jul 18, 2026
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 163aad2597

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Superseded by a simplified, ledger-free cut of CODAGT-757: #27369, #27370, #27371, #27372.

The new stack drops the database execution ledger entirely and instead relies on agent-side idempotent start tokens with at-least-once semantics: replays attach to the original process when the agent still knows the token, and re-run otherwise. The branches of this stack are kept as the salvage reference until the new stack merges.

This comment was written by Mux, an AI coding agent, operating on Mike's behalf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant