3 Commits

Author SHA1 Message Date
nandanadileep
c8bea81cbc fix: address CodeBuddy auth race conditions and file precedence
1. Race condition fix: Add generation counter to invalidate stale flow completions
   after cancel/logout. A flow completing after cancellation no longer overwrites
   the cancelled state.

2. Concurrent status polls: Share a single in-flight probe across concurrent
   status() calls instead of spawning separate SDK flows for each poll.

3. Cancellation propagation: Track all spawned flow tasks in _tasks set with
   done callbacks, ensuring proper cleanup even when tasks are cancelled or
   timeout.

4. File precedence fix: Check workbuddy-desktop.info before legacy file in
   find_auth_file(). WorkBuddy 5.9.3+ writes the desktop file; the legacy
   file may exist but be stale.

Adds regression tests based on reviewer feedback and Taz33m's reproduction.

Co-authored-by: Nandana Dileep <nandanadileep@users.noreply.github.com>
2026-11-12 06:41:25 +00:00
nandanadileep
e6046629ea fix: bound codebuddy auth flow awaits
Co-authored-by: Nandana Dileep <nandanadileep@users.noreply.github.com>
2026-11-12 06:41:25 +00:00
Ching Wing Kwok
8297fc7b7e feat(provider): add codebuddy as a LLM provider (#780)
* feat: add codebuddy provider

* fix: treat codebuddy as login-backed provider

* feat: sync codebuddy account models

* fix: ignore no-key placeholder for codebuddy

* feat: add codebuddy web login

* fix: streamline codebuddy settings and latency

* fix: support switching codebuddy accounts

* fix: preserve codebuddy sessions and tool calls

* feat: use CodeBuddy HTTP provider over Agent SDK

Chat with CodeBuddy over plain HTTP by reusing the login state that the
IDE plugin / CLI stores on disk, instead of bundling the ~130MB Agent SDK.

- add codebuddy_http_provider (OpenAI-compatible /chat/completions on
  <endpoint>/v2) with codebuddy_credentials for local OAuth session reuse
- provider_factory picks HTTP transport whenever a login state or API key
  is available; Agent SDK stays as fallback for CLI agent features
- demote codebuddy-agent-sdk from core deps to optional codebuddy extra
- default model codebuddy/default -> codebuddy/hy3
- update auth card UX and locales for SDK-less sign-in flow

* chore: label codebuddy provider as codebuddy/workbuddy in the dashboard

* style: apply pre-commit formatting after upstream merge

* chore: capitalise codebuddy provider label as CodeBuddy/WorkBuddy

---------

Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-08-13 00:02:42 +08:00