Skip to content

feat: add continuous session goals - #13679

Merged
marius-kilocode merged 14 commits into
mainfrom
add-goal-session-reruns
Sep 8, 2026
Merged

marius-kilocode merged 14 commits into
mainfrom
add-goal-session-reruns

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

High-level work needs another prompt after each completed turn. /goal keeps taking the next useful step in the same session while retaining the objective and its outcome.

Why This Change Was Made

The feature now has dedicated Goal domains instead of spreading behavior through shared session and chat files.

  • Backend Goal domain: packages/opencode/src/kilocode/session/goal/
  • VS Code Goal domain: packages/kilo-vscode/webview-ui/src/components/chat/goal/
  • Goal-specific styles live in webview-ui/src/styles/goal.css
  • Shared composer, session, permissions, and prompt code retain small integration hooks

Bare /goal opens the full composer so users can enter multiline objectives and attach images or files. /goal <objective> remains available as a shortcut. Escape and Cancel exit Goal input mode without discarding the draft or attachments.

Active goals disable the clarification tool to prevent unattended runs from waiting indefinitely for a question answer. Permission checks remain unchanged.

Goal state is persistent and distinguishes Active, Paused, Blocked, and Complete. The working model reports Complete or Blocked through goal_report; this is explicitly model-reported, not independently verified. No-action turns do not imply completion. Clear is the explicit removal action.

User Impact

  • Start a Goal from the full composer with multiline text and attachments.
  • Cancel or press Escape to return to normal chat while preserving the draft.
  • Start, pause, resume, restart, clear, and inspect Goal state from the existing controls.
  • Complete and Blocked goals retain their objective and reason until cleared.
  • Active Goal runs cannot open clarification questions, but still use normal permission approval rules.
  • Goal-specific behavior is isolated in dedicated backend and webview domains.
  • Goals use model credits and have no hard spending cap.

Evidence

  • Merged main through a7a7690caa.

  • Backend Goal and synchronization suites: 80 passed.

  • Full extension unit suite: 5,404 passed, 2 skipped, 0 failed.

  • Headless Goal CLI suite: 7 passed, including real piped-input admission tests on local macOS.

  • Backend typecheck, extension typecheck, lint, compile, Knip, annotation guards, formatting, and whitespace checks passed.

  • Goal browser regression suite: 13 passed, including action-row geometry, active status, tooltip behavior, responsive compaction, and restoration.

  • Isolated VS Code checks covered Goal input mode, attachment submission, Cancel/Escape preservation, Complete and Blocked rendering, Restart, Clear, and active clarification-tool exclusion.

  • Invalid replacement attachments preserve the existing running Goal. Pending composer mutations are blocked, and Cancel preserves the draft through acknowledgement. Covered by regression tests and isolated VS Code checks.

  • The previously failing stdin mocks have been replaced with real subprocess input tests. Linux and Windows validation awaits the updated CI run.

Goal CLI active state

Goal CLI paused state

Goal input mode in the composer

Goal action row

Goal complete state

Goal running state

Goal tooltip

Goal start mode

Goal status

Comment thread packages/tui/src/component/prompt/index.tsx Outdated
Comment thread packages/kilo-vscode/src/KiloProvider.ts Outdated
Comment thread packages/kilo-vscode/webview-ui/src/styles/chat-layout.css Outdated
Comment thread packages/opencode/src/kilocode/session/goal.ts Outdated
Comment thread packages/opencode/src/session/prompt.ts Outdated
Comment thread packages/opencode/src/session/prompt.ts Outdated
Comment thread packages/opencode/src/cli/cmd/run.ts
Comment thread packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx Outdated
Comment thread packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx Outdated
@kilo-code-bot

kilo-code-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/kilocode/session/goal.test.ts
Previous Review Summaries (3 snapshots, latest commit 5bfe44c)

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

Previous review (commit 5bfe44c)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/opencode/src/session/prompt.ts 1308 Stop during Goal attachment admission is turned into a defect
Files Reviewed (15 files)
  • .changeset/session-goals.md
  • packages/kilo-vscode/tests/fixtures/session-provider-activity.tsx
  • packages/kilo-vscode/tests/session-dock-stability.spec.ts
  • packages/kilo-vscode/tests/unit/prompt-send-contract.test.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/goal/useGoalComposer.ts
  • packages/kilo-vscode/webview-ui/src/context/session.tsx
  • packages/kilo-vscode/webview-ui/src/hooks/useImageAttachments.ts
  • packages/opencode/src/cli/cmd/run.ts
  • packages/opencode/src/kilocode/session/goal/runner.ts
  • packages/opencode/src/session/prompt.ts - 1 issue
  • packages/opencode/test/kilocode/cli/cmd/run-goal.test.ts
  • packages/opencode/test/kilocode/session/goal.test.ts
  • script/architecture-allowlist.json

Fix these issues in Kilo Cloud

Previous review (commit 9fe193c)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/opencode/src/kilocode/session/goal/runner.ts 255 Replacement still cancels the running goal before attachment persistence
packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx 650 Goal pending disables send but still allows editing the draft
Files Reviewed (83 files)
  • .changeset/session-goals.md
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/kilo-provider-utils.ts
  • packages/kilo-vscode/src/kilo-provider/command-completion.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/src/components/chat/SessionDock.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/goal/GoalHeader.tsx
  • packages/kilo-vscode/webview-ui/src/components/chat/goal/useGoalComposer.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/goal/useGoalDock.tsx
  • packages/kilo-vscode/webview-ui/src/context/session.tsx
  • packages/kilo-vscode/webview-ui/src/i18n/*.ts (20 locales)
  • packages/kilo-vscode/webview-ui/src/styles/chat-layout.css
  • packages/opencode/src/cli/cmd/run.ts
  • packages/opencode/src/command/index.ts
  • packages/opencode/src/kilocode/session/goal/runner.ts - 1 issue
  • packages/opencode/src/kilocode/session/goal/policy.ts
  • packages/opencode/src/kilocode/session/goal/state.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/kilocode/session/goal.test.ts
  • packages/tui/src/component/prompt/index.tsx
  • packages/tui/src/routes/session/index.tsx

Fix these issues in Kilo Cloud

Previous review (commit c42a0b1)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/tui/src/component/prompt/index.tsx 1537 Escape skips vim whenever a goal is active
packages/kilo-vscode/src/KiloProvider.ts 4139 Goal start/resume skip the revert checkpoint queue
packages/opencode/src/kilocode/session/goal.ts 78 Replacement/resume cancels the running goal before preflight
packages/opencode/src/session/prompt.ts 2292 Unknown commands pause the goal before validation
packages/opencode/src/session/prompt.ts 2018 Shell pauses the goal without cancelling, then can fail busy
packages/opencode/src/cli/cmd/run.ts 1027 Headless start/resume is rejected after session create/fork

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx 403 Goal menu still sits between dock and prompt, breaking flush spacing
packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx 417 aria-label="Goal" hides the visible objective from assistive tech
Files Reviewed (53 files)
  • .changeset/session-goals.md
  • packages/kilo-vscode/src/KiloProvider.ts - 1 issue
  • packages/kilo-vscode/src/kilo-provider-utils.ts
  • packages/kilo-vscode/src/kilo-provider/command-completion.ts
  • packages/kilo-vscode/src/kilo-provider/handlers/cloud-session.ts
  • packages/kilo-vscode/src/services/attention/service.ts
  • packages/kilo-vscode/tests/fixtures/session-provider-activity.tsx
  • packages/kilo-vscode/tests/unit/attention.test.ts
  • packages/kilo-vscode/tests/unit/cloud-session-handler.test.ts
  • packages/kilo-vscode/tests/unit/command-completion.test.ts
  • packages/kilo-vscode/tests/unit/kilo-provider-route-integration.test.ts
  • packages/kilo-vscode/tests/unit/kilo-provider-utils.test.ts
  • packages/kilo-vscode/tests/unit/prompt-send-contract.test.ts
  • packages/kilo-vscode/tests/unit/session-dock.test.ts
  • packages/kilo-vscode/webview-ui/src/components/chat/ChatView.tsx - 2 issues
  • packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
  • packages/kilo-vscode/webview-ui/src/context/session.tsx
  • packages/kilo-vscode/webview-ui/src/i18n/*.ts (20 locales)
  • packages/kilo-vscode/webview-ui/src/styles/chat-layout.css
  • packages/kilo-vscode/webview-ui/src/types/messages/sessions.ts
  • packages/opencode/src/cli/cmd/run.ts - 1 issue
  • packages/opencode/src/command/index.ts
  • packages/opencode/src/kilocode/cli/cmd/run.ts
  • packages/opencode/src/kilocode/cli/cmd/tui/component/goal.tsx
  • packages/opencode/src/kilocode/session/goal-state.ts
  • packages/opencode/src/kilocode/session/goal.ts - 1 issue
  • packages/opencode/src/session/prompt.ts - 2 issues
  • packages/opencode/src/session/session.ts
  • packages/opencode/test/kilocode/cli/cmd/tui/goal.test.tsx
  • packages/opencode/test/kilocode/run-drain.test.ts
  • packages/opencode/test/kilocode/session/goal.test.ts
  • packages/tui/src/component/prompt/index.tsx - 1 issue
  • packages/tui/src/routes/session/index.tsx

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 78.6K · Output: 8.2K · Cached: 282.1K

Review guidance: REVIEW.md from base branch main

@zakimimit

Copy link
Copy Markdown

@marius-kilocode thank you for working on this feature, I hope it will added in the upcoming release.

Comment thread packages/opencode/src/kilocode/session/goal/runner.ts
Comment thread packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx
Comment thread packages/opencode/src/session/prompt.ts
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.

3 participants