Skip to content

feat(coderd/x/chatd): persist execute tool intents and result commits in the execution ledger - #27318

Closed
ibetitsmike wants to merge 1 commit into
mike/codagt-757/01-ledger-schemafrom
mike/codagt-757/02-ledger-write-path
Closed

ibetitsmike wants to merge 1 commit into
mike/codagt-757/01-ledger-schemafrom
mike/codagt-757/02-ledger-write-path

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Starts writing the execution ledger from chatd's chat-semantics transactions: every execute tool call gets a reserved intent row when its assistant message commits, and gets result_committed_at stamped in the same transaction that commits its tool result.

Part 2/9 of the CODAGT-757 execution ledger stack (base: #1, ledger schema).

Changes

  • commitGenerationStep inserts one intent row per execute tool call in the just-committed assistant messages, inside the commit transaction: a rolled-back step leaves no row, a replayed commit no-ops on the lineage conflict.
  • The tool-result commit marks the executed calls result-committed in the same transaction. Interrupt-synthetic results are stamped by the interrupt transaction in PR 4 (feat(coderd/x/chatd): map the execution ledger at interrupt, reconcile kills, and sweep stalled cancels #27320), which owns the interrupt status mapping for ledger rows.
  • executionRecorder (minimal): per-chat handle binding ledger writes to the assistant message that issued the calls.
  • chattool.HashToolInput: SHA-256 over the raw persisted tool input, the lineage guard later claim validation depends on.
  • unresolvedToolCallsFromHistory now also returns the assistant message ID that issued the unresolved calls, anchoring ledger lineage.

Rows are only created and stamped here; claiming, dispatch, and status transitions land in the next PR. Interrupt handling for ledger rows (status mapping, synthetic-result stamping, kill reconciliation) lands in PR 4 (#27320); the periodic retry sweep lands in PR 5 (#27321).

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: 1964a16920

ℹ️ 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/01-ledger-schema branch from f331b42 to 304a8c9 Compare July 17, 2026 18:59
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from 1964a16 to e5903b1 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: e5903b12dc

ℹ️ 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/01-ledger-schema branch from 304a8c9 to 2ce0cfa Compare July 17, 2026 19:59
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from e5903b1 to 7b92e29 Compare July 17, 2026 19: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: 7b92e29dfc

ℹ️ 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
Comment thread coderd/x/chatd/execution_ledger_internal_test.go Outdated
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/01-ledger-schema branch from 2ce0cfa to db0cb36 Compare July 17, 2026 20:37
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from 7b92e29 to cdfa4b9 Compare July 17, 2026 20:37
@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: cdfa4b925a

ℹ️ 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/generation.go
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/01-ledger-schema branch from db0cb36 to 9a1fda5 Compare July 17, 2026 21:48
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from cdfa4b9 to 37e69cc Compare July 17, 2026 21:48
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 37e69cc73f

ℹ️ 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/02-ledger-write-path branch from 37e69cc to 8f97c0f Compare July 17, 2026 22:37
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/01-ledger-schema branch from 9a1fda5 to 4e3ba67 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. Nice work!

Reviewed commit: 8f97c0fbba

ℹ️ 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/02-ledger-write-path branch from 8f97c0f to 8182f91 Compare July 17, 2026 23:09
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/01-ledger-schema branch from 4e3ba67 to 511986e Compare July 17, 2026 23:09
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 8182f919f5

ℹ️ 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/01-ledger-schema branch from 511986e to b0f8d06 Compare July 17, 2026 23:39
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from 8182f91 to 8bc0b27 Compare July 17, 2026 23:39
@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: 8bc0b27939

ℹ️ 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

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: 8bc0b27939

ℹ️ 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

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 8bc0b27939

ℹ️ 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/01-ledger-schema branch from b0f8d06 to c9ef404 Compare July 18, 2026 00:44
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from 8bc0b27 to 2c4941e 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: 2c4941e64a

ℹ️ 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/01-ledger-schema branch from c9ef404 to f226359 Compare July 18, 2026 01:38
@ibetitsmike
ibetitsmike force-pushed the mike/codagt-757/02-ledger-write-path branch from 2c4941e to 95cd20d 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. Breezy!

Reviewed commit: 95cd20d2bc

ℹ️ 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.

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant