Skip to content

fix: nil pointer guards, worker slack adapter, translator logic, focus/digest wiring#9

Merged
LSUDOKO merged 2 commits into
mainfrom
fix/critical-bugs-worker-ai-translator-focus
Jul 11, 2026
Merged

fix: nil pointer guards, worker slack adapter, translator logic, focus/digest wiring#9
LSUDOKO merged 2 commits into
mainfrom
fix/critical-bugs-worker-ai-translator-focus

Conversation

@LSUDOKO

@LSUDOKO LSUDOKO commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Fixes

CRITICAL (crashes)

  • AI client nil pointer — Added extractContent helper guarding resp.Choices[0] access in all 5 methods. Panics on empty AI response are now handled.
  • Worker nil SlackAPI — Added workerSlackAPI adapter wrapping slack.Client to prevent panic on OpenDMChannel in digest scheduler.

HIGH (feature bugs)

  • Translator — Changed early return on no @-mentions → sends translation DM to current user when ambiguous language is detected without explicit mentions.
  • focus_open_thread — Wired button to sendSummaryToDM(): fetches channel history, runs AI summarization, posts to DM.
  • Digest threads — Populates threads section using AI GenerateDigestContent instead of always-empty slice.
  • Pre-existing bug — Added missing slackAPI argument to NewController call in cmd/api/main.go (caused compilation failure on main).

MEDIUM (polish)

  • Removed unused RateLimitInfo type and time import from ai/client.go.
  • Updated translator test to use mock AI server.

Verification

  • All Go packages build clean
  • All existing tests pass (including updated translator test)

…s/digest wiring

- AI client: add extractContent helper to guard resp.Choices[0] in all 5 methods
- Worker: add workerSlackAPI adapter wrapping slack.Client to prevent nil SlackAPI panic
- Translator: send translation DM to current user when ambiguous phrase lacks @-mentions
- Focus mode: wire focus_open_thread button to sendSummaryToDM with AI summary
- Digest: populate threads section using AI GenerateDigestContent
- dead code: remove unused RateLimitInfo type and time import
- Fix pre-existing compilation bug: pass slackAPI to NewController call in api/main.go
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@LSUDOKO, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 4dcb3d08-d32d-416c-8c14-205ded4bf697

📥 Commits

Reviewing files that changed from the base of the PR and between 9170832 and 5124a93.

📒 Files selected for processing (6)
  • api/cmd/worker/main.go
  • api/internal/ai/client.go
  • api/internal/features/digest.go
  • api/internal/features/focusmode.go
  • api/internal/features/translator.go
  • api/internal/features/translator_test.go

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@LSUDOKO
LSUDOKO merged commit f510bdc into main Jul 11, 2026
1 of 3 checks passed
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