Skip to content

fix(cli): resolve Bedrock SSO credentials - #12079

Merged
chrarnoldus merged 2 commits into
mainfrom
investigate-aws-bedrock-sso-error
Jul 10, 2026
Merged

fix(cli): resolve Bedrock SSO credentials#12079
chrarnoldus merged 2 commits into
mainfrom
investigate-aws-bedrock-sso-error

Conversation

@lambertjosh

@lambertjosh lambertjosh commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What changed

Build the packaged CLI with Bun and Node export conditions so AWS Bedrock can load the real Node credential chain instead of browser-only Symbol stubs. Replace the Solid scheduling primitives that become no-ops under Node conditions with timer-based implementations, preserving TUI session search and preview behavior.

Why

Kilo 7.4.0 changed minification in the VS Code extension bundle, but Bedrock credentials are resolved by the separately packaged CLI. The CLI still selected browser AWS/Smithy exports, causing SSO profiles to fail with errors such as KC is not a function where KC was a Symbol.

Upstream fixes

This is a targeted backport of the same approach OpenCode adopted upstream:

  • anomalyco/opencode#30873 / 1e216e12dc switched packaged builds from browser to Node conditions, fixing AWS/Smithy credential and event-stream resolution.
  • anomalyco/opencode#31748 / c51a1588c7 replaced Solid's browser-only scheduling primitive after Node conditions made it resolve to a server-side no-op.
  • a0409e64d8 later established the current upstream conditions: ["bun", "node"] form used here.

A straight cherry-pick is not suitable because Kilo has diverged from the relevant upstream tree: the TUI still lives under packages/opencode/src/cli/cmd/tui, while current upstream moved it into packages/tui, and Kilo has an additional session-preview leading/trailing scheduler with no direct counterpart in the upstream fix. Cherry-picking only #30873 would fix Bedrock but regress TUI search and preview scheduling. This PR therefore applies the equivalent build-condition change and ports the timer-based compatibility fix to both Kilo call sites.

@kilo-code-bot

kilo-code-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files, incremental)
  • packages/opencode/script/build.ts
  • packages/opencode/src/cli/cmd/tui/feature-plugins/session/preview-pane.tsx
  • packages/opencode/src/cli/cmd/tui/util/signal.ts

Notes: incremental diff since previous review (0a64070) only updates kilocode_change comment text on three lines, replacing a generic rationale with explicit references to the upstream PRs being ported/backported (anomalyco/opencode#30873, #31748, #31566). No logic, control flow, or test changes. Purely documentation/traceability improvement on existing marker comments -- no new findings.

Previous Review Summary (commit 0a64070)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 0a64070)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (7 files)
  • .changeset/fix-bedrock-sso.md
  • bun.lock
  • packages/opencode/package.json
  • packages/opencode/script/build.ts
  • packages/opencode/src/cli/cmd/tui/feature-plugins/session/preview-pane.tsx
  • packages/opencode/src/cli/cmd/tui/util/signal.ts
  • packages/opencode/test/kilocode/tui/signal.test.ts

Notes: verified the reimplemented createDebouncedSignal/createLeadingTrailingSignal timer logic against the new tests (leading-edge fire, trailing-edge coalescing, cleanup clears pending timers, no lingering @solid-primitives/scheduled references). The inline kilocode_change markers on shared upstream files (build.ts, signal.ts, preview-pane.tsx) mirror the shape of the upstream fixes being backported, which is the preferred approach for restoring/porting upstream behavior. Changeset is present and user-facing.


Reviewed by claude-sonnet-5 · Input: 20 · Output: 4K · Cached: 377.1K

Review guidance: REVIEW.md from base branch main

@lambertjosh

Copy link
Copy Markdown
Contributor Author

SSO is working:
image

@chrarnoldus
chrarnoldus merged commit d4b4a3f into main Jul 10, 2026
27 checks passed
@chrarnoldus
chrarnoldus deleted the investigate-aws-bedrock-sso-error branch July 10, 2026 07:08
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ck-sso-error

fix(cli): resolve Bedrock SSO credentials
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