Repository navigation
refactor(coderd/x/chatd): drop the unused runnerCtx from the runner debug turn - #31010
ibetitsmike wants to merge 2 commits into
Conversation
…ebug turn Deleting the run heartbeat left runnerDebugTurn.runnerCtx without a reader. Delete the field and the context parameter of newRunnerDebugTurn.
|
@codex review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review
|
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Deletes
runnerDebugTurn.runnerCtxand the context parameter ofnewRunnerDebugTurn. The field's only reader was theLaunchRunHeartbeatcall inensureLocked, which #30988 deleted with the run heartbeats, so nothing has read it since.Why it is safe: the constructor set the field and no code read it. The debug turn still uses the context of each call to
Ensure,ContextandFinalize, which this PR does not change.runner.goand 10 tests stop passing a context, and four of those tests drop thecontext.WithCancelthat they created only for this parameter.Validation:
go build ./coderd/x/chatd/...andgo vet ./coderd/x/chatd/...pass.TestRecordGenerationFinishFailure,TestSessionStartDispatchFailureFinishesGenerationandTestStartGeneration_CancelsDeletedToolCallsOnAgentpass under-race.golangci-lint run --fix=false ./coderd/x/chatd/reports 0 issues, and the pre-commit hook passed.Stack
This stack deletes the stale debug-run sweep, then simplifies the chatdebug debug-run, stream wrapper and step numbering code, drops the indexes the sweep used, and last deletes a runner debug field that lost its only reader with the heartbeats. The debug-run and stream wrapper refactors each sit on a test-only layer that pins the behavior they keep.
FinalizeStaleand the stale thresholdFinalizeStaleChatDebugRowsqueryrunnerCtxfrom the runner debug turn