Skip to content

feat(core): add autonomous auto-drive execution engine - #45837

Closed
eust-w wants to merge 1 commit into
anomalyco:devfrom
eust-w:auto-drive-engine
Closed

eust-w wants to merge 1 commit into
anomalyco:devfrom
eust-w:auto-drive-engine

Conversation

@eust-w

@eust-w eust-w commented Aug 28, 2026

Copy link
Copy Markdown

Summary

This PR introduces Auto-Drive (智能续推 / 自动领航), an autonomous execution engine that enables perpetual, self-driving session continuation across turns:

  1. Multi-dimensional Context Synthesis (packages/core/src/session/auto-drive.ts):

    • Tracks the inception user goal (initialGoal) across turns to avoid goal drifting during long-running sessions.
    • Captures worker output (lastText) and checks for explicit upcoming steps, continuation prompts, and completion status.
    • Supports both cold-start default prompt and contextual goal-aligned steering instructions.
  2. Project Memory & Strategy Distillation (.opencode/auto-drive.md):

    • Integrates with .opencode/auto-drive.md in the project root to load active roadmaps, milestones, and learned patterns.
    • Automatically persists updated roadmaps and rules produced by the supervisor model.
  3. Supervisor Model Steering with Graceful Degradation:

    • Implements autonomous supervisor review with 15-second timeout protection and full exception fallback to heuristic pattern matching.
    • Safe execution guards: auto-drive continuation only triggers when the assistant turn completes successfully (finish === "stop").
  4. UI & User Experience Integration:

    • Adds an interactive "Auto-Drive" toggle button with a status indicator (🟢/⚪) in the prompt input footer (packages/app/src/components/prompt-input-v2.tsx).
    • Adds settings controls for Auto-Drive toggle and custom continuation prompt in both general settings pages (SettingsGeneral & SettingsGeneralV2).
    • Adds built-in /autodrive and /auto-drive slash commands (packages/core/src/plugin/command.ts, packages/opencode/src/command/index.ts, .opencode/command/auto-drive.md).
    • Sets default user composer follow-up delivery mode to queue so human interventions insert smoothly into the ongoing workflow without abrupt termination.
  5. Infinite Exponential Backoff for Provider Transient Failures:

    • Updates retry policy (packages/opencode/src/session/retry.ts) to retry without a fixed 5-attempt cap on 429/5xx errors, ensuring resilience for long-running autonomous sessions.

Testing

  • Auto-Drive Unit Tests: Added 16 comprehensive unit tests in packages/core/test/session-auto-drive.test.ts (100% pass).
  • Session Runner Integration: All 88 regression tests in packages/core/test/session-runner.test.ts pass cleanly (100% pass).
  • Session Prompt Admission: All 24 tests in packages/core/test/session-prompt.test.ts pass cleanly (100% pass).
  • Type Checking: Full repository bun turbo typecheck (30/30 packages) and bun typecheck pass with 0 errors.

- Implement multi-dimensional context synthesis with inception goal tracking
- Add Markdown memory distillation to .opencode/auto-drive.md
- Introduce supervisor model steering with graceful heuristic degradation
- Add interactive UI toggle with status indicator and settings controls
- Support /autodrive and /auto-drive slash commands
- Set default client follow-up delivery mode to queue
- Enable infinite exponential backoff retry for provider transient errors
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR Found:

Why it might be related: Both PRs appear to be part of the autonomous execution feature set, with PR #45379 focusing on the goal command aspect and PR #45837 (current) implementing the broader auto-drive execution engine that includes goal tracking (initialGoal) and autonomous steering. They may be complementary features working together, or there could be overlapping functionality in goal management and autonomous execution logic.

Recommend checking if PR #45379 is merged or still open, and whether there's any overlap in the goal command implementation versus the auto-drive engine's goal tracking capabilities.

@eust-w

eust-w commented Aug 28, 2026

Copy link
Copy Markdown
Author

Closing to update with English-first localization, refreshed defaults, and an expanded architectural philosophy.

@eust-w eust-w closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant