Skip to content

feat: update SDK integration for @clinebot 0.0.35#377

Merged
BarreiroT merged 2 commits into
mainfrom
bee/sdk-0.0.35
Apr 21, 2026
Merged

feat: update SDK integration for @clinebot 0.0.35#377
BarreiroT merged 2 commits into
mainfrom
bee/sdk-0.0.35

Conversation

@abeatrix
Copy link
Copy Markdown
Collaborator

  • switch Kanban dependencies from local SDK links to published @clinebot/{shared,llms,agents,core} 0.0.35
  • update runtime/session boundary code to match the current core session host and start-session contracts
  • refresh SDK event typings to include newer session events and hook kinds
  • update provider boundary imports for the current @clinebot/core export surface
  • adapt system prompt construction to the latest getClineDefaultSystemPrompt options API
  • remove temporary local-workspace TS path overrides and legacy persistence fallback introduced during branch-compat work
  • fix Kanban type issues surfaced by the stricter 0.0.35 SDK typings

- switch Kanban dependencies from local SDK links to published
  @clinebot/{shared,llms,agents,core} 0.0.35
- update runtime/session boundary code to match the current core session
  host and start-session contracts
- refresh SDK event typings to include newer session events and hook kinds
- update provider boundary imports for the current @clinebot/core export
  surface
- adapt system prompt construction to the latest getClineDefaultSystemPrompt
  options API
- remove temporary local-workspace TS path overrides and legacy persistence
  fallback introduced during branch-compat work
- fix Kanban type issues surfaced by the stricter 0.0.35 SDK typings
@abeatrix abeatrix requested a review from saoudrizwan April 21, 2026 07:43
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR migrates the Kanban SDK integration from @clinebot/* 0.0.34 to 0.0.35: import paths are consolidated to @clinebot/core (dropping the /node sub-path and @clinebot/shared sub-imports), createSessionHost is replaced with ClineCore.create, StartSessionInput is renamed to ClineCoreStartInput, userInstructionWatcher is nested under localRuntime, getClineDefaultSystemPrompt adopts an options-object signature, and the session-title persistence hack is replaced with the new first-class update?() method. New session event variants (pending_prompts, pending_prompt_submitted) and the agent_error hook kind are also registered. The one remaining concern is updateActiveSessionMode, which still uses an as unknown as { sessions? } internal cast that was not updated alongside the other workaround removals.

Confidence Score: 5/5

Safe to merge; all contract-breaking API changes are correctly adapted and tests are updated.

All P0/P1-class concerns are addressed: import paths, factory API, start-session contract, system-prompt options, and session-title persistence are all correctly updated. The one remaining finding (updateActiveSessionMode internal cast) is a pre-existing pattern that already degrades gracefully via optional chaining; it does not introduce new breakage in this PR and is P2.

src/cline-sdk/cline-session-runtime.ts — updateActiveSessionMode private method (lines 512–518) uses a stale internal cast that may become a no-op after the ClineCore.create change.

Important Files Changed

Filename Overview
src/cline-sdk/sdk-runtime-boundary.ts Core boundary file updated: createSessionHost replaced with ClineCore.create, StartSessionInput with ClineCoreStartInput, system-prompt call converted to options object, imports consolidated from @clinebot/core; new event types added (pending_prompts, pending_prompt_submitted) and agent_error hook added; one remaining internal cast in updateActiveSessionMode not addressed.
src/cline-sdk/cline-session-runtime.ts Session runtime updated: userInstructionWatcher correctly wrapped under localRuntime, legacy sessionService.updateSession cast replaced with the new first-class update?() method on the session host boundary; updateActiveSessionMode still uses an as unknown as internal cast.
src/cline-sdk/sdk-provider-boundary.ts Import path updated from @clinebot/core/node to @clinebot/core; TypeScript type annotation added to model mapper lambda to satisfy stricter 0.0.35 typings.
src/cline-sdk/cline-provider-service.ts Type-predicate guard added to org.active filter and explicit annotation added to org mapper to resolve stricter 0.0.35 type errors; logic is unchanged.
test/runtime/cline-sdk/cline-session-runtime.test.ts Test stubs updated to use the new top-level update method instead of the nested sessionService.updateSession shape; assertions updated accordingly.
package.json All four @clinebot/* dependencies bumped from ^0.0.34 to ^0.0.35.

Sequence Diagram

sequenceDiagram
    participant K as Kanban
    participant RT as InMemoryClineSessionRuntime
    participant SH as SessionHost (ClineCore.create)

    K->>RT: startTaskSession(request)
    RT->>SH: start({ config, prompt, localRuntime: { userInstructionWatcher } })
    SH-->>RT: { sessionId, result }
    RT->>SH: update?(sessionId, { title })
    Note over RT,SH: best-effort only, errors swallowed

    K->>RT: sendTaskSessionInput(taskId, prompt, mode)
    RT->>SH: send({ sessionId, prompt, delivery? })
    Note over RT,SH: mode change via internal cast (may silently fail)

    K->>RT: stopTaskSession / abortTaskSession
    RT->>SH: stop(sessionId) / abort(sessionId)
    SH-->>RT: ended event
    RT->>RT: clearTaskSessionBinding + releaseTaskMcpToolBundle
Loading

Comments Outside Diff (1)

  1. src/cline-sdk/cline-session-runtime.ts, line 512-518 (link)

    P2 Remaining internal cast not updated alongside update?.()

    This PR correctly replaced the sessionService.updateSession workaround with the new first-class update?() method, but updateActiveSessionMode still reaches into the SDK object's internal sessions map via as unknown as { sessions?: Map<…> }. With ClineCore.create returning a potentially different object shape in 0.0.35, this cast will silently no-op if the internal structure has changed — mode changes sent via sendTaskSessionInput would not be applied to the live session. Consider checking whether SessionHost now exposes a supported API for in-flight mode updates (similar to update?.()), or at minimum adding a debug log when the cast finds no session.

Reviews (1): Last reviewed commit: "feat: update SDK integration for @clineb..." | Re-trigger Greptile

Comment thread src/cline-sdk/cline-provider-service.ts Outdated
Copy link
Copy Markdown
Collaborator

@BarreiroT BarreiroT left a comment

Choose a reason for hiding this comment

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

LGTM - Thank you!

@BarreiroT BarreiroT merged commit 58942a8 into main Apr 21, 2026
3 checks passed
@BarreiroT BarreiroT deleted the bee/sdk-0.0.35 branch April 21, 2026 20:18
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.

2 participants