Skip to content

feat: add /goal command for autonomous task completion #31762

Closed as not planned
Closed as not planned

Description

@simply-sunny

Summary

Add a /goal slash command that sets a completion condition and keeps the agent working across turns until the condition is met. This is inspired by Claude Code's /goal command and OpenAI Codex's Goal Mode.

Motivation

Currently, users must manually prompt the agent after each step for multi-step tasks. A /goal command would allow users to define a completion condition once and let the agent work autonomously until the goal is achieved.

Proposed Behavior

Commands

  • /goal <condition> - Set a new goal and start working toward it
  • /goal (no args) - Show current goal status
  • /goal clear - Clear the active goal

How it works

  1. User sets a goal with a completion condition
  2. Agent works toward the goal in the current turn
  3. After each turn, an evaluator model checks if the condition is met
  4. If not met, the evaluator's reason is fed back and the agent continues
  5. If met, the goal clears and an achieved entry is logged

Evaluator

  • Uses a configurable small/fast model (default: session's configured model)
  • Only judges from the conversation transcript (does not run tools)
  • Returns yes/no decision with a short reason
  • Conditions should be phrased around observable output

Goal State

  • Stored per-session in the database
  • Tracks: condition, status (active/achieved/cleared), iterations, tokens, timestamps
  • Emits events for UI updates

Example Usage

/goal All tests in test/auth pass and lint is clean

The agent will then:

  1. Run the tests
  2. Check lint
  3. If tests fail, fix them and re-run
  4. Continue until both conditions are met

Design Decisions

  • Independent from todos: Goal is a session-level objective, separate from task lists
  • Configurable evaluator: Users can specify a custom evaluator model
  • Session-scoped: Goals are per-session, not persistent across sessions
  • V1 command system: Matches existing /init and /review pattern

Testing

  • Unit tests for SessionGoal service
  • Unit tests for goal evaluator
  • Integration tests for /goal command
  • Tests for auto-continuation behavior

References

Activity

  1. github-actions commented on Jun 10, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature requests must use the Feature Request template, which requires the title to start with [FEATURE]: and include the verification checkbox confirming the feature hasn't been suggested before.

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


    This issue might be a duplicate of existing issues. Please check:

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

  2. github-actions commented on Jun 10, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions