Skip to content

feat/goal command - #132

Open
smasher6081 wants to merge 2 commits into
fcying:mainfrom
smasher6081:feat/goal-command
Open

smasher6081 wants to merge 2 commits into
fcying:mainfrom
smasher6081:feat/goal-command

Conversation

@smasher6081

Copy link
Copy Markdown
  • feat(bridge): add /goal to keep a task running until its goal completes
  • docs: document /goal and its rpc continuation requirement

OMP's goal mode is the built-in answer to a turn that ends mid-task: the
runtime drives continuation turns until the goal is complete, but only for
modes listed in `goal.continuationModes`, and only when a host creates the
goal through the RPC `goal` method. The bridge exposed neither.

- `/goal <objective>` submits the objective as an ordinary prompt, then
  creates the goal once that turn is streaming, so goal mode attaches as a
  steer instead of scheduling a turn the bridge would not own.
- While the goal is active, a terminal `agent_end` no longer settles the
  task; the runtime's continuation turn arrives under the same inbox, with
  the same delivery guarantees.
- `goal_updated` ends the deferral when the goal completes, is dropped, or
  pauses, settling the task instead of leaving it open.
- Bounded by maxGoalTurns so a runtime that keeps yielding turns without
  finishing cannot hold the conversation busy.
- `/goal status` and `/goal off` wrap the RPC get/drop ops.

Verified end to end against OMP 19.4.4: a 7.4-minute task spanned four agent
turns (three continuation turns) and settled once, with the goal completed
and a single delivery. Unit tests cover the goal-updated transitions, the
deferral counter and the pending-objective guard.
README and README.zh gain the command row and a Goal mode section covering
`goal.continuationModes: [interactive, rpc]`, the 50-turn bound and the
short-objective caveat. architecture.md and its translation record the
create-on-streaming, deferral and goal_updated settlement invariants.
@fcying

fcying commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR. I'm interested in adding goal support, but there are several issues to address before merging:

  • The 50-turn limit only clears bridge state without stopping the native goal.
  • An active goal does not guarantee continuation. Use native settlement signals to avoid leaving the worker busy indefinitely.
  • Creating a goal on agent_start introduces a race condition. RPC timeouts also need to handle uncertain outcomes.
  • Goal state is not properly integrated with task completion, Stop, runtime teardown, and session recovery.
  • Synchronous RPC calls block the worker. Please reuse the existing asynchronous operation mechanism.

Please reuse the existing steer and autoresearch lifecycle mechanisms where appropriate, keep the implementation simple, and add regression tests for these cases.

The above findings are based on static code review. Please also verify the implementation against a real OMP runtime.

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.

2 participants