Skip to content

Add agent autonomy presets - #9750

Merged
imanolmzd-svg merged 17 commits into
mainfrom
feat-hitl-onboarding-preferences
Jun 12, 2026
Merged

Add agent autonomy presets#9750
imanolmzd-svg merged 17 commits into
mainfrom
feat-hitl-onboarding-preferences

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

Summary

  • Ask new VS Code users to choose Review-first or High autonomy defaults during first-run onboarding, with the same preset picker in Agent Behaviour settings.
  • Keep the high-autonomy preset safe by changing only visibility defaults while leaving approval rules unchanged.

Closes #8419

Comment thread packages/kilo-vscode/src/shared/work-style-presets.ts Outdated
@kilo-code-bot

kilo-code-bot Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx 128 WorkStyleOnboarding200 renders same component as WorkStyleOnboardingDefault without a width constraint — the "narrow width" story is identical to the default
Resolved Issues
File Issue
packages/kilo-vscode/src/kilo-provider/work-style.ts Previous SUGGESTION about redundant workStyleLoaded post after handleWorkStyleApplyMessage — fixed
packages/kilo-vscode/webview-ui/src/context/onboarding/work-style-toasts.ts open callback parameter removed; settings link moved into the picker card instead of the toast action
Incremental Updates (since 740155a)

Two new commits:

  • 50040608refactor(onboarding): relocate settings access from toast into picker card: removes the "Go to Settings" toast action and its open callback parameter; adds a persistent "You can change these options anytime in Settings." note directly in WorkStylePicker. The bash detail is also removed from the picker's bullet list. Clean refactor, no logic issues.
  • a99c498achore: update kilo-vscode visual regression baselines: updates PNG baselines to reflect the new picker layout. No code changes.
Other Observations (not in diff)
File Issue
packages/kilo-vscode/webview-ui/src/i18n/*.ts (all 16 languages) workStyle.onboarding.skip, workStyle.toast.saved.description, and workStyle.toast.saved.action keys are present but no longer used anywhere in the UI — orphaned keys can be cleaned up when convenient
Files Reviewed (60 files)
  • .changeset/hitl-onboarding-preferences.md - 0 issues
  • packages/kilo-vscode/package.json - 0 issues
  • packages/kilo-vscode/src/KiloProvider.ts - 0 issues
  • packages/kilo-vscode/src/kilo-provider/work-style-apply-handler.ts - 0 issues
  • packages/kilo-vscode/src/kilo-provider/work-style-apply.ts - 0 issues
  • packages/kilo-vscode/src/kilo-provider/work-style.ts - 0 issues
  • packages/kilo-vscode/src/services/telemetry/types.ts - 0 issues
  • packages/kilo-vscode/src/shared/work-style-presets.ts - 0 issues
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/work-style-apply.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/work-style-presets.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/work-style-state.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/transcript-cache.test.ts - 0 issues
  • packages/kilo-vscode/tests/unit/transcript-rows.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/sortable-tab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/App.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/AssistantMessage.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/MessageList.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/SidebarEmptyState.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/TaskTimeline.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/TranscriptRow.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/WelcomeEmptyState.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/transcript-cache.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/settings/AgentBehaviourTab.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/components/shared/WorkStylePicker.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/context/onboarding/work-style-toasts.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/context/transcript-rows.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/context/work-style-state.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/context/work-style.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/stories/chat.stories.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx - 1 issue (SUGGESTION, carried forward)
  • packages/kilo-vscode/webview-ui/src/styles/welcome.css - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts - 0 issues
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/settings/work-style-onboarding-200-chromium-linux.png - 0 issues
  • packages/kilo-docs/public/img/screenshot-tests/kilo-vscode/visual-regression/settings/work-style-onboarding-default-chromium-linux.png - 0 issues
  • packages/sdk/js/src/v2/gen/types.gen.ts - 0 issues

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 938,152 tokens

Review guidance: REVIEW.md from base branch main

@lambertjosh

Copy link
Copy Markdown
Contributor

OK I got it to work, the problem was that it was also only showing if you did not have any existing sessions in your history.
image

A few thoughts:

  1. Generally like it.
  2. It's a lot of content and therefore wraps badly on default sidebar width, has the team overlay on top, and other minor UI issues. Nothing major, just need to clean this up a bit.
  3. When you pick one you get dropped back to the empty new state. It would be nice to have a confirmation perhaps show telling you that your preferences were saved, and where to change them if you want, or perhaps a link to the docs.
  4. If you pick Skip for now what happens? We should probably make it clear fewer interruptions is the default.

imanolmzd-svg and others added 4 commits June 9, 2026 10:41
…tence and add skipped state

Replace globalState-based `onboardingShown` flag with a new `skipped`
enum value in the `agentWorkStyle` VS Code setting. This makes the
onboarding flow re-triggerable by setting the config back to `unset`
and removes the need for extension context in work-style handlers.

- Add `skipped` to WorkStyleState enum for dismissing without choosing
- Remove `onboardingShown` from messages and context provider
- Add `watchWorkStyleConfig` to reactively push changes to webview
- Extract `SidebarEmptyState` and `WelcomeEmptyState` components from
  MessageList for cleaner separation of concerns
- Pass `emptyState` prop through ChatView to allow sidebar-specific
  onboarding UI without coupling MessageList to WorkStyleProvider
Comment thread packages/kilo-vscode/webview-ui/src/stories/settings.stories.tsx
imanolmzd-svg and others added 4 commits June 11, 2026 09:58
…oading

Add a listener for the extensionDataReady message so that the
WorkStyleProvider retries data fetching when the extension signals
readiness, preventing a stale loading state caused by race conditions
during webview initialization.
@imanolmzd-svg
imanolmzd-svg force-pushed the feat-hitl-onboarding-preferences branch from 947aef2 to ec7a5ff Compare June 11, 2026 10:20
github-actions Bot and others added 2 commits June 11, 2026 10:23
…e resolver

Decouple onboarding visibility from the persisted WorkStyleState by
introducing a dedicated `display` signal driven by
resolveWorkStyleOnboarding(). The onboarding panel now auto-persists
"skipped" on first render (one-off semantics) and dismisses itself on
newTaskRequest events. Unit tests cover the three resolution branches.
@imanolmzd-svg

imanolmzd-svg commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Visual Changes

  • Updated texts to be more beginner-friendly
  • Made the sections clickable (Removed buttons)
  • Added a confirmation toast on option selected
  • Updated the UI on narrow windows to display a summarized view - See Storybook captures

Other Implementation details

  • This window appears if there are no sessions for that VSCode profile (No sessions on any workspace)
  • It appears including if the user opened VSCode without a directory selected (No folder open)
  • Added telemetry

Testing

  • Tested on a fresh installation that the view appears
  • Tested a user with existing sessions don't see this view
  • Tested clicking the different options have the correct effect both on VSCode settings and Kilo Settings
  • Tested ignoring the options, and just typing in the chat clears the view (Marked as "Skipped")
  • Tested ignoring the options doesn't trigger the view again when starting a new session
Screen.Recording.2026-06-11.at.12.06.15.mov

Comment thread packages/kilo-vscode/package.json
Comment thread packages/kilo-vscode/src/shared/work-style-presets.ts Outdated
@marius-kilocode

marius-kilocode commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

As an existing user, how can I use this? Is this only part of the onboarding now?

Comment thread packages/kilo-vscode/webview-ui/src/context/work-style.tsx Outdated
Comment thread packages/kilo-vscode/webview-ui/src/context/work-style.tsx Outdated
@imanolmzd-svg

Copy link
Copy Markdown
Contributor

As an existing user, how can I use this? Is this only part of the onboarding now?

Yes, it's only part of the onboarding

Persist skipped state only after onboarding is bypassed, apply presets through one rollback-aware extension operation, and use the human-in-the-loop identifier consistently.
Comment thread packages/kilo-vscode/src/kilo-provider/work-style.ts Outdated
The apply handler already posts the updated work-style payload
internally, so the additional post here caused a redundant message
to be sent to the webview after each style application.
@imanolmzd-svg

Copy link
Copy Markdown
Contributor

Benchmark results

I benchmarked this PR at 740155a8 against base 91298442 using three fresh isolated VS Code profiles per version.

The scenario measured a cold Kilo sidebar open on a new profile. The PR rendered the new first-run work-style picker, while the base rendered the standard empty state.

Metric Base PR Change
CPU non-idle self-time 448.2 ms 473.8 ms +5.7%
Task duration 450.8 ms 480.0 ms +6.5%
Script duration 80.9 ms 93.5 ms +15.5%
Style recalculation 8.9 ms 11.3 ms +2.4 ms
Layout duration 2.05 ms 2.16 ms +0.11 ms
Longest task 316.4 ms 326.8 ms +3.3%
Long tasks 2 2 unchanged
Settled DOM elements 769 784 +15
Settled buttons 14 15 +1

The functional behavior matched the intended design:

  • A fresh profile displayed both Review First and High Autonomy options.
  • Selecting Review First persisted the preference, hid the picker, and restored the standard welcome view.
  • The confirmation toast displayed Preferences saved with a link to Settings.
  • The clean functional run produced no console errors.

Overall, the PR adds a modest amount of cold initialization work, consistent with rendering the additional onboarding UI. The absolute style and layout increases were small, warm-idle behavior was effectively unchanged, and there was no observable responsiveness regression. With only three runs and some baseline DOM variability, these results do not demonstrate a meaningful user-visible performance regression.

@imanolmzd-svg

Copy link
Copy Markdown
Contributor

Current UI

image

imanolmzd-svg and others added 2 commits June 12, 2026 17:56
… card

Move the "Go to Settings" call-to-action out of the post-save toast
and into a persistent inline link at the bottom of the WorkStylePicker.
Simplify the success toast to a short 2-second confirmation, tighten
choice descriptions for conciseness, drop the bash detail row, and
remove the small-viewport rule that hid mode details.
@imanolmzd-svg
imanolmzd-svg enabled auto-merge (squash) June 12, 2026 16:09
@imanolmzd-svg
imanolmzd-svg merged commit 57f2e79 into main Jun 12, 2026
23 checks passed
@imanolmzd-svg
imanolmzd-svg deleted the feat-hitl-onboarding-preferences branch June 12, 2026 16:17
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
* feat(vscode): add agent autonomy presets

* feat(work-style): simplify onboarding state to use config-only persistence and add skipped state

Replace globalState-based `onboardingShown` flag with a new `skipped`
enum value in the `agentWorkStyle` VS Code setting. This makes the
onboarding flow re-triggerable by setting the config back to `unset`
and removes the need for extension context in work-style handlers.

- Add `skipped` to WorkStyleState enum for dismissing without choosing
- Remove `onboardingShown` from messages and context provider
- Add `watchWorkStyleConfig` to reactively push changes to webview
- Extract `SidebarEmptyState` and `WelcomeEmptyState` components from
  MessageList for cleaner separation of concerns
- Pass `emptyState` prop through ChatView to allow sidebar-specific
  onboarding UI without coupling MessageList to WorkStyleProvider

* chore: update kilo-vscode visual regression baselines

* feat(work-style): refine onboarding preferences

* feat(webview): re-request work style on extensionDataReady if still loading

Add a listener for the extensionDataReady message so that the
WorkStyleProvider retries data fetching when the extension signals
readiness, preventing a stale loading state caused by race conditions
during webview initialization.

* chore: update kilo-vscode visual regression baselines

* feat(work-style): improve onboarding flow

* chore: update kilo-vscode visual regression baselines

* refactor(onboarding): extract work style display logic into pure state resolver

Decouple onboarding visibility from the persisted WorkStyleState by
introducing a dedicated `display` signal driven by
resolveWorkStyleOnboarding(). The onboarding panel now auto-persists
"skipped" on first render (one-off semantics) and dismisses itself on
newTaskRequest events. Unit tests cover the three resolution branches.

* style(welcome): widen responsive breakpoint for work-style empty state

* fix(vscode): make work style onboarding updates reliable

Persist skipped state only after onboarding is bypassed, apply presets through one rollback-aware extension operation, and use the human-in-the-loop identifier consistently.

* fix(work-style): remove duplicate payload post after apply handler

The apply handler already posts the updated work-style payload
internally, so the additional post here caused a redundant message
to be sent to the webview after each style application.

* refactor(onboarding): relocate settings access from toast into picker card

Move the "Go to Settings" call-to-action out of the post-save toast
and into a persistent inline link at the bottom of the WorkStylePicker.
Simplify the success toast to a short 2-second confirmation, tighten
choice descriptions for conciseness, drop the bash detail row, and
remove the small-viewport rule that hid mode details.

* chore: update kilo-vscode visual regression baselines

---------

Co-authored-by: Imanol Maiztegui <imanol.mzd@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

[FEATURE]: Ask new users how they like to work with agents

3 participants