Repository navigation
feat(environments): explain package policy and Anaconda sign-in failures - #163
romulorosa wants to merge 12 commits into
Conversation
…to their own codes
The bridge now reports why a transaction failed. Map blocked_by_policy to
POLICY_BLOCKED, not_signed_in and auth:not-signed-in to NOT_SIGNED_IN, and
access_denied and auth:access-denied to CHANNEL_ACCESS_DENIED, and give
no_channels_configured, package_not_found and channel_not_found their codes.
Other reasons, and results from older bridges without one, stay SOLVE_FAILED.
The blocked packages, the policy note and the refused org and channel ride
on one final `[policy] {json}` line of the error message, which the agent
reads as is and parseEnvironmentsErrorMessage strips from the detail. Failed
job events carry the notice too.
…and count them The conda tools that solve (create, clone, install, update) and conda.repodata.find now tell the agent to report a blocked package, its policy, org and reason verbatim, never to retry from another channel, pip or a URL, to suggest asking the org's administrator, and to ask the user to sign in to Anaconda (not Kilo) on NOT_SIGNED_IN / CHANNEL_ACCESS_DENIED without ever asking for a token. The conda-forge fallback guidance now says a blocked package is not unavailable, and the no-channels guidance names NO_CHANNELS_CONFIGURED. A tool failure that is a policy block, an Anaconda sign-in refusal or a solve failure with a policy note sends the new Environment Policy Blocked event (surface, error code, counts and up to five policy UUIDs, never names) and is rethrown unchanged.
…Settings friendlyEnvironmentsError now returns the code, message, detail and policy notice of a failure. A policy block's message is the bridge's summary, and a sign-in refusal names the refused channel. The new PolicyErrorDetails lists each blocked package with its policy, org and reason verbatim, shows the policy note of a solve failure, and offers "Sign in to Anaconda" through kilo.anaconda/account (optional; the button is hidden without it). The Add packages and Update previews title their error card per code (a policy block, an Anaconda sign-in or a dependency conflict) and re-run the preview after a sign-in. Job failure toasts show the same details. Each shown failure sends Environment Policy Blocked with surface ui.
…w-ups The bundled conda bridge now authenticates to Anaconda's governed package repository with the signed-in user's Anaconda API key, sends nothing when the user is signed out, and never sends repository tokens. The security overview says so, and its validation checklist covers the bridge's packaged conda configuration, which a system-wide configuration or an inherited conda root can bypass. The plugin architecture lists what this leaves open.
0.1.23 reports why a transaction failed (blocked_by_policy, not_signed_in, access_denied, ...), explains policy blocks with the blocked packages, and authenticates to Anaconda's governed package repository with the signed-in user's Anaconda API key instead of repository tokens.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (3 files)
Previous Review Summaries (3 snapshots, latest commit 9154527)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9154527)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous review (commit 9aca6d5)Status: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (13 files)
Fix these issues in Kilo Cloud Previous review (commit d11ec62)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (37 files)
Assumption: the toast-surface telemetry defect was verified against the kernel telemetry declaration gate and the shell-hosted Reviewed by deepseek-v4.1-flash-1017 · Input: 38.3K · Output: 8K · Cached: 557.2K |
…vironments kilo.shell hosts <Toaster>, so a toast's content renders with kilo.shell's sdk and the kernel dropped the environment-policy-blocked event it sent as undeclared. The environments component that starts a job now binds its own reporter (useJobToasts), and the failure is reported when its toast is raised, not from inside the toast. Browser tests host the Toaster as kilo.shell to prove the event is accepted for kilo.environments.
…ilo.anaconda require
…rting tool wrapper The wrapper that reports policy failures called each tool's run with its input only, dropping the ToolCallContext (the call's abort signal and chat identity) that the tool gateway passes.
…from conda.envs.clone The backend reports every failed clone as SOLVE_FAILED without a policy reason or a [policy] line, so clone's description no longer carries the policy guidance; it says a policy or sign-in failure comes back as a generic clone error and must not be routed around.
|
Addressed all four findings (each verified first):
Validation: |
|
Addressed the clone sign-in suggestion in 9154527: a raised |
|
React Doctor found no issues. 🎉 Reviewed by React Doctor for commit |
…-channel-error-handling-and-n # Conflicts: # docs/plugin-architecture.md # docs/security-architecture-overview.md
Explain package-policy blocks and Anaconda sign-in failures in conda environments, for the agent and in Settings, and bump the bundled bridge payload to 0.1.23.
Payload 0.1.23 reports why a conda transaction failed (
reasonplus structureddetails) and authenticates to Anaconda's governed package repository with the signed-in user's Anaconda API key. Until now kilo.environments turned every failed transaction intoSOLVE_FAILED("Dependency conflict"), and raisedauth:*errors becamePROVIDER_NOT_READY("backend not ready"). A package blocked by an organization's policy looked like a conflict, and a signed-out user looked like a starting backend. The bump and the mapping ship together, so no release shows signed-out users the old misleading errors.Error codes and transport
POLICY_BLOCKED,NOT_SIGNED_INandCHANNEL_ACCESS_DENIED(allBUSINESS). The error vocabulary now has 18 codes.blocked_by_policy→POLICY_BLOCKED;not_signed_in/auth:not-signed-in→NOT_SIGNED_IN;access_denied/auth:access-denied→CHANNEL_ACCESS_DENIED;no_channels_configured,package_not_found,channel_not_found→ their existing codes.solve_failed,execution_failed,internal_error, unknown reasons and results from older bridges without a reason staySOLVE_FAILED, so nothing regresses. Clone keeps its inlineSOLVE_FAILED(the bridge never sets a reason on clones).CondaRuntime.creategets the same codes; kilo.local-inference has no code-specific "retry later" handling (it logs, tries the next channel set, then reports a generic configuration error).KernelErrorcarries only a code and a message, so the message keepsCODE: detailand gains one optional final line,[policy] {json}, holding aPolicyNotice(blocked[]withpackage, version, channel, org, policy, policyId, reason;policyNote;refused {org, channel}). The agent reads the line verbatim;parseEnvironmentsErrorMessagestrips it fromdetailand returns it aspolicy; a malformed trailing line stays indetail. Failed job events carrypolicytoo. The bridge's message text is never parsed for policy data.Agent
conda.repodata.findtell the agent to report the package, policy, org and reason verbatim, never retry from another channel, pip or a URL, suggest asking the organization's administrator, and onNOT_SIGNED_IN/CHANNEL_ACCESS_DENIEDask the user to sign in to Anaconda (not Kilo) in Kilo Desktop, never asking for a token in the chat.NO_CHANNELS_CONFIGURED.requiresSignIngate is unchanged: the Kilo and Anaconda sign-ins stay separate.Settings
friendlyEnvironmentsErrorreturns{code, message, detail?, policy?}. A policy block's message is the bridge's summary (the lines before the first blank line), and a sign-in refusal names the refused channel.PolicyErrorDetails: lists each blocked package with its policy, org and reason; shows the policy note; and offers "Sign in to Anaconda" throughkilo.anaconda/account(optional inrequires; the button is hidden without kilo.anaconda).Telemetry
Environment Policy Blockedevent (environment-policy-blocked), sent from the conda tools in main (surface: agent_tool, the first telemetry kilo.environments sends from main) and from the Settings catch paths (surface: ui). Data:surface,errorCode,blockedCount,policyNote, and up to 5 deduplicated policy UUIDs. It never includes package, channel, org or policy names, or reason text.Docs
SOLVE_FAILEDfailures and Anaconda sign-out outside the model catalog.docs/plugins/schema.mdis regenerated.Release note
Conda environments now explain when your organization's package policy blocks a package, and when a channel needs you to sign in to Anaconda. Kilo Desktop's conda now authenticates to Anaconda's package repository with your Anaconda account. If you relied on repository tokens, or on
~/.condarcrouting toanaconda-auth, sign in to Anaconda in Kilo Desktop.Test plan
pnpm lint(oxlint, boundaries, schema doc, React Compiler check),pnpm format:checkpnpm check(all 28 typecheck tasks)pnpm --filter @kilo-desktop/plugin-environments coveragepasses the 80% gate (96% lines, 87% branches)node scripts/check-plugin-isolation.mjs --build environmentsapps/webkernel app tests andapps/desktopplugin/removability testsauth:*domain codes, and results without a reason (SidecarCondaBackend.test.ts); job events carry the notice; tool guidance, the unchanged policy line and the telemetry payload (tools.test.ts,entry.test.tsthrough the FakeBridge); friendly messages and card titles; AddPackage (sign-in re-runs the preview, failed sign-in, no kilo.anaconda, policy toast) and Update (policy block, policy note) browser testsdefaultsfrom the chat givesPOLICY_BLOCKEDwith the policy and reason, the agent reports it verbatim and does not try conda-forge; the Add packages preview shows the policy cardNOT_SIGNED_IN(notPROVIDER_NOT_READY/SOLVE_FAILED);conda.repodata.findnames the refused channel; "Sign in to Anaconda" opens the browser sign-in and the preview re-runs