Skip to content

chore: drop chat gateway key columns#27172

Draft
ibetitsmike wants to merge 1 commit into
mike/chat-synthetic-keys/stop-legacy-storagefrom
mike/chat-synthetic-keys/drop-columns
Draft

chore: drop chat gateway key columns#27172
ibetitsmike wants to merge 1 commit into
mike/chat-synthetic-keys/stop-legacy-storagefrom
mike/chat-synthetic-keys/drop-columns

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Mux is working on behalf of Mike.

Summary

Drop the unused api_key_id columns from chat messages and queued messages after #27171 stops reading and writing them.

The down migration re-adds nullable text columns without foreign keys so rollback reproduces the amended #27171 schema. Previous column values cannot be restored. Deploy only after #27171 is fully deployed.

Depends on #27171.

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

Mux is working on behalf of Mike.

Dogfood migration UAT passed.

  • Started chore: drop chat gateway key columns #27172 against the preserved PR1 and PR2 database.
  • Verified both legacy columns and both legacy foreign keys were absent.
  • Verified the synthetic mapping primary key, uniqueness constraint, and cascading foreign keys remained.
  • Existing PR1 and PR2 chats loaded successfully.
  • A new PR3 chat completed with the expected response.
  • Deleted an ordinary session key during an active generation. The chat state was unchanged at deletion time and the generation completed normally with no error.
  • Captured real Agents UI evidence showing the preserved PR1/PR2 chats and new PR3 chat.

@ibetitsmike ibetitsmike changed the title chore(coderd/database): drop chat gateway key columns chore: drop chat gateway key columns Jul 10, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 72c2c0ad02

ℹ️ 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/chat-synthetic-keys/drop-columns branch from 72c2c0a to d2c8c25 Compare July 10, 2026 18:21
@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/stop-legacy-storage branch from 6635cd2 to 7557de2 Compare July 10, 2026 18:21
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/stop-legacy-storage branch from 7557de2 to 2a464a3 Compare July 10, 2026 19:01
@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/drop-columns branch from d2c8c25 to 7618beb Compare July 10, 2026 19:01
@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/stop-legacy-storage branch from 2a464a3 to e6a9d4f Compare July 10, 2026 19:23
@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/drop-columns branch from 7618beb to c077b35 Compare July 10, 2026 19:23
@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/drop-columns branch from c077b35 to 2de350a Compare July 10, 2026 19:37
@ibetitsmike ibetitsmike force-pushed the mike/chat-synthetic-keys/stop-legacy-storage branch from e6a9d4f to 21f7269 Compare July 10, 2026 19: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. You're on a roll.

Reviewed commit: 2de350aa78

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

Mux is working on behalf of Mike.

Final-stack targeted dogfood passed after the FK-decoupling fix.

  • PR1 head 500b588185: both legacy API-key FKs were absent. Deleting the mapped synthetic key during an active generation left history_version, queue_version, and generation_attempt unchanged at deletion time. The generation completed normally, compatibility text IDs remained, and the next turn reminted a new synthetic key.
  • PR2 head 21f726957a: the preserved PR1 chat loaded, a new FINAL-PR2 chat completed, legacy columns remained nullable and unwritten, and the FKs remained absent.
  • PR3 head 2de350aa78: preserved PR1 and PR2 chats loaded, a new FINAL-PR3 chat completed, and the legacy columns and FKs were absent.

This supplements the earlier full UI/API/database UAT and validates the final rewritten stack heads.

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