Skip to content

[feat] /goal persisted long-horizon workflows - #54

Merged
echobt merged 6 commits into
mainfrom
cursor/goal-persisted-workflows-2181
Sep 8, 2026
Merged

[feat] /goal persisted long-horizon workflows#54
echobt merged 6 commits into
mainfrom
cursor/goal-persisted-workflows-2181

Conversation

@echobt

@echobt echobt commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds long-horizon persisted goals (/goal) to Cortex CLI / Cortex Code, stored with the session so an objective survives turn end, compaction, and TUI resume.

  • /goal <objective> create/replace the active goal and kick off a plan→act→verify turn
  • /goal status (objective, state, progress, budget)
  • /goal pause / resume / clear (reserved tokens only when they are the entire argument)
  • States: active | paused | complete | budget_limited | blocked
  • Idle continuation while active and within budget (default 8 turns; wrap-up near the limit)
  • Evidence-based completion via the UpdateGoal tool (reason + file/command/test evidence). The model cannot pause. Failed updates are atomic.
  • goal.json next to session meta.json / history.jsonl
  • Slash palette (after /plan) and composer chip in designer accent #1F4945

Lock v2 boards (designer + runtime) now include /goal PNG locks at 40×12 and 120×40:

  • goal-chip-active / paused / done / budget / blocked — composer chip text-only (no radios)
  • slash-palette with /goal after /plan

Live /goal smoke uses these env names only (never commit or log values):

Variable Role
OPENAI_BASE_URL or CORTEX_LLM_BASE_URL Astra /v1 (docs/test default http://84.32.63.4:20128/v1)
OPENAI_API_KEY or CORTEX_LLM_API_KEY Operator-injected key
CORTEX_LLM_MODEL cx/gpt-6-astra (gpt-astra 404s)

If no key is present, unit tests still pass and the live smoke prints SKIP: with that list. Agent mode still uses the Cortex API; this does not add a third product provider.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy -p cortex-tui --all-targets -- -D warnings (pre-existing explicit_counter_loop in untouched files only)
  • Targeted tests: lock_v2 + lock_v2_goal + lock_palette (goal chip copy, /goal after /plan at both sizes, unique frames, no retired palette)
  • Lock PNGs unique at 36 (40×12) and 82 (120×40); accent #1F4945 present; 0 violet #A78BFA
  • Full CI (./scripts/clippy.sh, cargo test --workspace, TUI job, audit, coverage)

Attestation (required)

I attest that:

  • Security reviewed — auth, exec/sandbox, path traversal, network egress, and secret handling in this diff were reviewed. No secrets, tokens, or keyring dumps are in the change.
  • Product-facing errors — user-visible failures use Cortex product copy. API-down paths say The coding service is temporarily unavailable. No raw provider, SDK, or transport names.
  • TUI verified — every TUI surface touched in this PR was exercised (build + headless snapshot / ratatui-style test, and a real run when a TTY was available).
  • Tests added — unit tests cover the new logic; TUI changes include a snapshot or buffer assertion. No mocks that report success.
  • No secrets — no API keys, WorkOS secrets, R2/AWS credentials, or .env files are included.

Risk

Protocol adds Op::Goal and EventMsg::GoalUpdated. Session goal.json is local metadata only. Live smoke is skip-by-default without a key. Compatible /v1 env names are aligned; Cortex Agent auth is unchanged. Quality line-count debt on lock_v2.rs is reduced by extracting scene ids.

Open in Web Open in Cursor 

cursoragent and others added 3 commits September 8, 2026 09:25
Add /goal create-status-pause-resume-clear, session goal.json,
UpdateGoal evidence completion, idle continuation within budget,
composer chip, and openai-compatible env names for live Astra smoke.

Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
Co-authored-by: Mathis <echobt@users.noreply.github.com>
@echobt echobt changed the title [feat] /goal persisted long-horizon workflows (Codex-parity) [feat] /goal persisted long-horizon workflows Sep 8, 2026
cursoragent and others added 3 commits September 8, 2026 09:50
Neutralize CHANGELOG composer wording and comment leftovers.
Keep lock-proof bans that forbid competitor names in chrome.

Co-authored-by: Mathis <echobt@users.noreply.github.com>
Scrub remaining provider-brand prose in /goal docs and comments.

Co-authored-by: Mathis <echobt@users.noreply.github.com>
Capture composer chip states and slash-palette /goal after /plan at
40x12 and 120x40 via the existing board and runtime pipelines.

Co-authored-by: Mathis <echobt@users.noreply.github.com>
@echobt
echobt marked this pull request as ready for review September 8, 2026 10:21
@echobt
echobt merged commit 4d41ef3 into main Sep 8, 2026
20 checks passed
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Too many files changed for review (102 files, 100 file limit).

Bypass the limit by tagging @greptile-apps to review.

@echobt
echobt deleted the cursor/goal-persisted-workflows-2181 branch September 8, 2026 10:22
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