Skip to content

refactor(shared): hubClient residual pure-helper peel (#901)#908

Merged
DeliciousBuding merged 1 commit into
masterfrom
chore/901-hubclient-residual-peel
Jul 17, 2026
Merged

refactor(shared): hubClient residual pure-helper peel (#901)#908
DeliciousBuding merged 1 commit into
masterfrom
chore/901-hubclient-residual-peel

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

Closes #901

Summary

Continue the hubClient pure-helper strangler after #833:

  • Extract remaining pure path/query builders from createHubClient call sites into hubClientPayloadUtils.ts (session/message/task/execution-target/team/document/etc.).
  • Extract pure JSON RequestInit builders (buildJsonPostInit / put / patch / delete + method-only helpers).
  • Extract shared parseHubSuccessResponse into hubClientEnvelope.ts so request / upload / 401-retry success peels stay DRY.
  • Drop unused qs import from hubClient.ts; keep createHubClient as thin request orchestration.

Zero behavior change. exactOptionalPropertyTypes-safe (no undefined assignments; optional body still uses conditional omit via buildOptionalJsonBody).

Size

  • hubClient.ts: 981 → 878 (−103 LOC net)

Test plan

  • pnpm --filter @agenthub/shared exec vitest run src/hubClient9 files / 50 tests passed
  • No hubClient-related tsc errors
  • git diff --check clean

Continue pure residual after #833: path/query builders for remaining
encodeURIComponent call sites, JSON RequestInit helpers, and shared
parseHubSuccessResponse peel for request/upload/retry. createHubClient
stays thin orchestration; zero behavior change; exactOptional-safe.

Closes #901
Copilot AI review requested due to automatic review settings July 17, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 16 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 56d8df3a-3751-4468-be09-a6ae3d77da4a

📥 Commits

Reviewing files that changed from the base of the PR and between 497ba26 and 22af83d.

📒 Files selected for processing (5)
  • app/shared/src/hubClient.ts
  • app/shared/src/hubClientEnvelope.test.ts
  • app/shared/src/hubClientEnvelope.ts
  • app/shared/src/hubClientPayloadUtils.test.ts
  • app/shared/src/hubClientPayloadUtils.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/901-hubclient-residual-peel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@DeliciousBuding
DeliciousBuding merged commit 24173b6 into master Jul 17, 2026
16 checks passed
@DeliciousBuding
DeliciousBuding deleted the chore/901-hubclient-residual-peel branch July 17, 2026 20:49
DeliciousBuding added a commit that referenced this pull request Jul 17, 2026
Close Phase 46 rollup (#898#903 / PRs #904#908) and activate Phase 47
design token residual + godfile peels (#909#914, milestone 68).
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.

P46: hubClient residual — extract pure method helpers continue

2 participants