Skip to content

goal mode: keep a long-running session working until the goal's exit criteria hold (like Codex /goal) #99

Closed

Description

@lx-0

Need

Codex has /goal: the agent gets a goal and keeps working until it is reached, often for days, spinning off its own subagents (Gergely Orosz, "Inside OpenAI's agentic software factory", 2026-09-15). ytstack has the pieces of this but not the clamp:

  • ytstack:coordinate is the long-running session that owns a plan and dispatches lanes.
  • autonomy: loop chains plan-task, TDD, verification and summarize inside a slice.
  • Every milestone has exit criteria in M###-CONTEXT.md.

What is missing: nothing keeps the session going. A turn ends whenever the model thinks it is done. No check asks whether the goal's exit criteria hold, and if not, whether there is a real blocker or an open question for the person. In the meinKontext coordinator run, lanes sat idle overnight with nobody holding them (#84).

Proposal

  1. ytstack-goal set <milestone>|"<sentence>" [--until <ISO UTC>|--rounds N] writes the goal as a session marker, out of tree like the coordinate marker. A milestone goal takes that milestone's exit criteria. A sentence goal needs at least one checkable criterion, given as a command with exit 0 or a file that must exist. ytstack-goal status and ytstack-goal clear complete the command.
  2. The Stop hook blocks the stop while a goal is open, with the unmet criteria listed. It lets the stop through when:
    • a question to the person is open and asked (ytstack-questions);
    • a blocker is recorded;
    • work in the background is pending (running lanes, a watched PR);
    • the bound (--until or --rounds) is reached; the hook then says so once.
  3. stop_hook_active is respected, and a goal never blocks twice in a row without a tool call in between, so it cannot loop.
  4. coordinate sets the plan's current milestone as the goal at its start, unless one is set. The checklist says to clear it when the milestone closes.
  5. Codex: where the host has its own /goal, the skill text says to use it and ytstack does not register the hook.

Related: #79 (once the lane state lives on the host and with the session rather than in repo files, the long-running session needs this clamp), #83 (rotation), #84 (liveness).

Metadata

Metadata

Assignees

No one assigned

    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