Skip to content

feat(vscode): part 1 - foundation utils and gateway bridge#333

Open
bernaferrari wants to merge 8 commits intoKilo-Org:devfrom
bernaferrari:codex/split-01-foundation-utils-gateway
Open

feat(vscode): part 1 - foundation utils and gateway bridge#333
bernaferrari wants to merge 8 commits intoKilo-Org:devfrom
bernaferrari:codex/split-01-foundation-utils-gateway

Conversation

@bernaferrari
Copy link
Contributor

@bernaferrari bernaferrari commented Feb 16, 2026

I'm trying to split #321 and this is part 1.

This is AI generated:

Part 1/20: Foundation Utilities + Gateway Plumbing

This PR is the first slice of the #321 split and focuses on low-risk foundation pieces that unblock later feature PRs.

Mapping to migration plan

This PR advances items already marked in https://github.com/Kilo-Org/kilo/blob/4c1f5168631366360ecdbe0106495925455d8d78/packages/kilo-vscode/docs/opencode-migration-plan.md:

  • infrastructure/dedicated-output-channel.md (logger foundation)
  • pre-prod security checklist:
    • validate openExternal URLs
    • review/tighten CSP
    • audit workspace path containment

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

}

export function buildWebviewCsp(input: WebviewCspInput): string {
return [
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems duplicate with the CSP in KiloProvider; I have no problem with extracting it, but I don't think it should be duplicated.

@@ -0,0 +1,32 @@
import * as vscode from "vscode"
Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be integrated with / deduplicated with src/services/autocomplete/shims/TelemetryStub.ts

@@ -0,0 +1,54 @@
import * as vscode from "vscode"
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we want this instead of just plain old console logs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the goal was to emit on both console.log and vscode output channel, so it is easy for user no matter their preference.. I can remove it, if you prefer.

/* ===== Typography =====
* opencode UI components use --font-family-sans/mono variables.
* Bridge them to VS Code-native font settings inside the extension.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

}

function getOrganizationId(auth: any): string | undefined {
return auth?.type === "oauth" ? auth.accountId : undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't get this logic; Why is the organization the accountId, and it seems like a user only has one org looking at this code, but I'd say they can have multiple?

return c.json(settings)
},
)
.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to keep the session management out of this, as I'd need someone else to review it.

@@ -0,0 +1,91 @@
import { KILO_API_BASE } from "./constants.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

As said below, i think the remote sessions need to be in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll move them to a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can take a break from this PR. I'll get your points addressed soon.

@bernaferrari
Copy link
Contributor Author

bernaferrari commented Feb 16, 2026

I simplified a lot (maybe too much 🤣), fixing what you commented. Check if you prefer landing this PR or if you prefer me to close and have these changes as part of the others (like marketplace/etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants