🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

fix: chatd refactor - #26270

Merged
hugodutka merged 9 commits into
mainfrom
hugodutka/chatd-refactor
Jun 12, 2026
Merged

fix: chatd refactor#26270
hugodutka merged 9 commits into
mainfrom
hugodutka/chatd-refactor

Conversation

PR 1 of the chatd refactor. It serves 2 purposes:
1. it implements the chat state machine; and
2. it contains all the database changes in the chatd refactor PR stack.

I kept the database changes in a single PR to make rebasing easier.
However, because of it, this PR doesn't compile and it doesn't pass
tests - that's intentional. Only the tip of the stack will pass all
tests.
@github-actions

github-actions Bot commented Jun 11, 2026

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/admin/integrations/prometheus.md

PR 2 of the chatd refactor. Reimplements the chatd http endpoints to use
the state machine from #25908.

Adds a new `/chats/$id/reconcile-invalid` endpoint to allow admins to
recover chats that end up in an invalid state from the perspective of
the state machine.

Removes many chatd tests because the state machine PR introduced tests
that replace them.

The CI doesn't pass on purpose. Only the tip of the chatd refactor PR
stack will pass CI.
PR 3 of the chatd refactor. Refactors the chatd worker to use the chatd
state machine.

The CI doesn't pass on purpose. Only the tip of the chatd refactor PR
stack will pass CI.

Previous PR in the stack: #25923
PR 4 of the chatd refactor. Implements the `/chats/$id/stream` and
`/chats/$id/stream/parts` endpoints.

The CI doesn't pass on purpose. Only the tip of the chatd refactor PR
stack will pass CI.

Previous PR in the stack: #26109
PR 5 of the chatd refactor. Adapts the frontend to work with the
refactored `/chats/$id/stream` endpoint.

Previous PR in the stack: #26110
…26112)

PR 6 of the chatd refactor. Originally not included in the RFC - I
wasn't aware that `workspaceAgentAddChatContext` existed. It seems to be
an internal endpoint that the workspace agent can call to inject
additional context into the chat. I don't think it's used in production
today, but I refactored it either way.

Previous PR in the stack: #26111
@hugodutka
hugodutka requested review from johnstcn and mafredri June 11, 2026 17:16
@hugodutka
hugodutka force-pushed the hugodutka/chatd-refactor branch from d408d6d to daebff7 Compare June 11, 2026 18:31
@hugodutka
hugodutka force-pushed the hugodutka/chatd-refactor branch from daebff7 to 3ae86d2 Compare June 11, 2026 21:05
@hugodutka

Copy link
Copy Markdown
Contributor Author

It looks like the flake check is failing because the refactor touched so many tests that, with the aggressive flake hunting settings the check runs with (among others -count 35), and the standard make test timeout of go test -timeout 20m per package, the check is timing out.

@johnstcn johnstcn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤞 After much testing

@mafredri mafredri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤞🏻

@johnstcn

Copy link
Copy Markdown
Member

main is on schema version 518

@hugodutka
hugodutka merged commit 4debd23 into main Jun 12, 2026
52 of 56 checks passed
@hugodutka
hugodutka deleted the hugodutka/chatd-refactor branch June 12, 2026 11:33
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 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.

3 participants