Skip to content

chore(coderd/x/chatd): improve runner logging#26522

Merged
hugodutka merged 1 commit into
mainfrom
hugodutka/expected-exit-reasons
Jun 18, 2026
Merged

chore(coderd/x/chatd): improve runner logging#26522
hugodutka merged 1 commit into
mainfrom
hugodutka/expected-exit-reasons

Conversation

@hugodutka

@hugodutka hugodutka commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Follow up to #26412.

  • Ensure that each errTaskExpectedExit and any other error is joined with a descriptive reason. This will enable runChatWithRetry to log a descriptive message when a task exits.
  • Pass additional task information like chat id into runTaskWithRetry so logs can be more descriptive.

@datadog-coder

This comment has been minimized.

@hugodutka hugodutka force-pushed the hugodutka/expected-exit-reasons branch from 3f0832b to 5601ea1 Compare June 18, 2026 15:26
return errors.Join(errTaskExpectedExit, xerrors.Errorf("generation action: %w", actionErr), ctx.Err())
}
if errors.Is(actionErr, errTaskExpectedExit) || errors.Is(actionErr, chatloop.ErrInterrupted) {
return nil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Swallowing these errors here conflates responsibilities. It's the job of runTaskWithRetry to handle errTaskExpectedExit.

input chatWorkerTaskStartInput,
locked database.Chat,
) error {
if s.server == nil {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this can never happen in practice. this guard was redundant

@hugodutka hugodutka changed the title chore(coderd/x/chatd): ensure every errTaskExpectedExit has a reason chore(coderd/x/chatd): improve runner logging Jun 18, 2026
@hugodutka hugodutka force-pushed the hugodutka/expected-exit-reasons branch from 5601ea1 to 264deb2 Compare June 18, 2026 15:38
@hugodutka hugodutka force-pushed the hugodutka/workspace-ctx-marker-fix branch from 2bd76cd to 6a1723a Compare June 18, 2026 15:44
@hugodutka hugodutka force-pushed the hugodutka/expected-exit-reasons branch 2 times, most recently from 0e0d4f2 to 9393f2d Compare June 18, 2026 15:55
@hugodutka hugodutka force-pushed the hugodutka/workspace-ctx-marker-fix branch from 6a1723a to ee60ee3 Compare June 18, 2026 15:55
Base automatically changed from hugodutka/workspace-ctx-marker-fix to main June 18, 2026 16:08
@hugodutka hugodutka force-pushed the hugodutka/expected-exit-reasons branch from 9393f2d to 3a3fe52 Compare June 18, 2026 16:29
@hugodutka hugodutka force-pushed the hugodutka/expected-exit-reasons branch from 3a3fe52 to 21998b7 Compare June 18, 2026 16:46
@hugodutka hugodutka merged commit c0c0d1e into main Jun 18, 2026
29 checks passed
@hugodutka hugodutka deleted the hugodutka/expected-exit-reasons branch June 18, 2026 17:02
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 18, 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.

2 participants