Skip to content

fix: sync desktop rewards gift balance from cloud credits#922

Draft
nettee wants to merge 5 commits intomainfrom
dev-0408-2
Draft

fix: sync desktop rewards gift balance from cloud credits#922
nettee wants to merge 5 commits intomainfrom
dev-0408-2

Conversation

@nettee
Copy link
Copy Markdown
Contributor

@nettee nettee commented Apr 8, 2026

What

Use the cloud credits summary as the source of truth for desktop rewards gift balance, and show that value in the workspace sidebar.

Why

The desktop rewards UI could show an incorrect gift balance because it relied on rewards status data that does not carry the full credit balance shape. This keeps the displayed balance aligned with the cloud credits API and preserves a usable fallback when rewards status cannot be fetched.

How

  • fetch /api/v1/credits/summary alongside rewards status and reward claim flows, then map its balance payload into desktop rewards status
  • extend shared reward/credit schemas and generated web API types so giftBalance is available end to end, while preserving fallback behavior when the credits summary call fails
  • update the workspace sidebar to read giftBalance from cloudBalance, add focused tests, and reset the local profile authSource when switching cloud profiles

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • pnpm generate-types run (if API routes/schemas changed)
  • No credentials or tokens in code or logs
  • No any types introduced (use unknown with narrowing)

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 47.24409% with 67 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
apps/controller/src/store/nexu-config-store.ts 46.87% 34 Missing ⚠️
...ps/controller/src/services/cloud-reward-service.ts 36.58% 26 Missing ⚠️
apps/web/src/layouts/workspace-layout.tsx 66.66% 5 Missing ⚠️
apps/web/src/i18n/locales/en.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7b8fec2e9f

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

Comment thread apps/controller/src/store/nexu-config-store.ts Outdated
Comment thread apps/controller/src/store/nexu-config-store.ts Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f55b784276

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

Comment thread apps/controller/src/store/nexu-config-store.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab31a2d3ea

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

Comment thread apps/controller/src/store/nexu-config-store.ts
@nettee nettee marked this pull request as draft April 8, 2026 09:50
@Celina-create Celina-create added priority:p2 P2-nice-to-have: Low impact, backlog type:feature Issue type is a feature request area/frontend Frontend (React/Electron UI) good-first-issue Good for newcomers labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend Frontend (React/Electron UI) good-first-issue Good for newcomers priority:p2 P2-nice-to-have: Low impact, backlog type:feature Issue type is a feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants