Skip to content

fix(session): apply fast effort guidance before first write - #855

Merged
agenteinstinct1-max merged 3 commits into
dev-vibecodedfrom
fix/fast-first-request-guidance-854
Nov 12, 2026
Merged

agenteinstinct1-max merged 3 commits into
dev-vibecodedfrom
fix/fast-first-request-guidance-854

Conversation

@agenteinstinct1-max

@agenteinstinct1-max agenteinstinct1-max commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Issue for this PR

Refs #854

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Apply fast effort guidance on the first implementation request, before any file writes, and use the current session effort when preparing Work delegation guidance.
  • Prefer native file tools for ordinary changes and batch independent operations on different files, while keeping dependent calls and same-file writes ordered. Keep scripting for useful bulk work and recovery.
  • Align Work and reviewer-description guidance with fast's existing no-independent-review, minimal-validation policy. Preserve explicit review requests and other effort policies.
  • Add request-composition, effort-switching, reviewer/Think and shared-guidance regressions.

Scope and limits

This corrects conflicting instructions and missing early fast guidance. It does not establish why the reported run spent more than four minutes in commands, and it does not claim a measured model speedup. No tool runtime, permission, workflow, dependency, keyboard or layout changes are included.

How did you verify your code works?

The exact twelve-file candidate was tested with offline fixtures:

  • Prompt controls: 13 passed, 148 assertions, including Think after a plan-file write and after compaction.
  • Reviewer delegation, system and style controls: 64 passed, 1 platform-specific skip on Linux, 300 assertions.
  • Restoring only the old reviewer-description source made the captured-request absence regression fail (0 passed, 1 failed, 6 assertions) and the delegation-surfaces regression fail (0 passed, 1 failed, 14 assertions). Restoring the candidate made both pass (12 and 15 assertions).

Restoring only the prior prompt-composition source made both assembled Think regressions fail on leaked Work guidance (0 passed, 2 failed, 6 assertions). Restoring the corrected source made the focused prompt group above pass.

Recorded native-provider replay: 3 passed, 1 missing-cassette skip, 24 assertions. The three existing cassettes now include the new efficiency guidance in both expected requests. Only six prompt-string leaves changed; recorded responses, request non-prompt fields, metadata and interaction counts are unchanged. No provider recording or live provider call was used.

No heavy typecheck, full suite or provider performance benchmark has run locally. Independent full review and fresh CI remain required before merge.

Screenshots / recordings

Not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown

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.

@kilo-code-bot

kilo-code-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (11 files)
  • packages/opencode/src/agent/agent.ts
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/src/session/prompt/efficiency.txt
  • packages/opencode/src/session/system.ts
  • packages/opencode/src/tool/task.txt
  • packages/opencode/test/fixtures/recordings/session/native-anthropic-tool-loop.json
  • packages/opencode/test/fixtures/recordings/session/native-openai-oauth-tool-loop.json
  • packages/opencode/test/fixtures/recordings/session/native-zen-tool-loop.json
  • packages/opencode/test/session/prompt.test.ts
  • packages/opencode/test/session/review-delegation.test.ts
  • packages/opencode/test/session/system.test.ts
Previous Review Summaries (2 snapshots, latest commit d99bd28)

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

Previous review (commit d99bd28)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/opencode/src/session/prompt.ts - previous finding resolved
  • packages/opencode/test/session/prompt.test.ts - new regression tests added

Previous review (commit 061e111)

Status: 1 Issue Found | Recommendation: Address before merge

Fix these issues in Kilo Cloud

Overview

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

WARNING

File Line Issue
packages/opencode/src/session/prompt.ts 2409 showEffortProcess injects full effort process guidance into think after prior file writes

packages/opencode/src/session/prompt.ts:2409 — showEffortProcess is computed as !isReviewAgent(agent.name) && (sessionWroteFiles || (effort === "fast" && agent.name !== "think")). For a think session in a transcript that already has file-write markers (or a compaction marker preserving the policy), sessionWroteFiles becomes true and this condition returns true, so the request receives EFFORT_PROCESS[...] (e.g. “Start straightforward implementation…”). Later handling only appends the bare ## Agent effort label when the process block did not fire, so this path bypasses Think’s planning-only framing. Consider excluding think from the write-gated branch as well (or otherwise preserving Think-specific guidance) so post-write/compacted Think turns do not receive Work implementation-process instructions.

Files Reviewed (9 files)
  • packages/opencode/src/agent/agent.ts - no issues
  • packages/opencode/src/session/prompt.ts - 1 issue
  • packages/opencode/src/session/prompt/efficiency.txt - no issues
  • packages/opencode/src/session/system.ts - no issues
  • packages/opencode/src/tool/task.txt - no issues
  • packages/opencode/test/session/prompt.test.ts - no issues
  • packages/opencode/test/session/review-delegation.test.ts - no issues
  • packages/opencode/test/session/ste-lite.test.ts - no issues
  • packages/opencode/test/session/system.test.ts - no issues

Review context: fetched PR metadata/diff, inline comments (none), issue comments, and reviews (none) via gh; inspected all changed files and relevant changed regions with read. No existing inline review comments to reconcile. Direct sed reads of specific ranges were rejected by the environment, so line-level verification relied on full-file reads and the PR diff.


Reviewed by free · Input: 105.2K · Output: 8.1K · Cached: 780.4K

@agenteinstinct1-max
agenteinstinct1-max merged commit d2708bf into dev-vibecoded Nov 12, 2026
8 checks passed
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.

1 participant