6 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
85c91992c7 Merge PR #2582: fix: CodeBuddy provider: /auth/start can permanently wedge the settings API + incompatibilities with WorkBuddy 5.9.3 des
Replace in-request backoff with a monotonic cache, shield shared status probes, bound SDK startup and flow waits, retain child task ownership, and fence stale probe/login results across start, cancel, and logout (35 passed).
2026-11-14 23:23:00 +08:00
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
8518ac2fcc fix: reformat test function signature to pass ruff format check
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
XZH
df5bc6e86b test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.

Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
2026-10-03 20:36:12 -07: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