Skip to content

fix(agents): enforce command-driven REPL state - #196

Merged
FluffyAIcode merged 1 commit into
mainfrom
AgentMemory/repl-command-state-machine-0718
Jul 18, 2026
Merged

fix(agents): enforce command-driven REPL state#196
FluffyAIcode merged 1 commit into
mainfrom
AgentMemory/repl-command-state-machine-0718

Conversation

@FluffyAIcode

Copy link
Copy Markdown
Owner

Summary

  • replace first-line artifact heuristics with explicit WAITING_FOR_GOAL / READY / RUNNING states
  • accept only /continue, /steer <text>, /new <goal>, and /quit after goal anchoring
  • reject all bare text after the initial goal, including copied model-output fragments
  • never read stdin during Generator/Critic inference
  • atomically persist complete goal, Generator, Critic, and run ID to a private 0600 checkpoint
  • recover an exact completed turn from the timestamped transcript and optionally auto-continue after restart

Truncation diagnosis

The model output was not truncated. Run br_2a37518138bfab7c completed with Generator and Critic EOS. The authoritative log shows a complete accepted input, while Terminal displayed an asynchronously overwritten Operator ... \\mat fragment. This PR removes the implicit-input path that allowed automation to race the prompt boundary.

Recovery validation

Recovered from the real pre-incident run:

  • run: br_2a37518138bfab7c
  • Generator: 4,223 characters
  • Critic: 3,762 characters
  • immutable goal: recovered from the anchored transcript

Tests

  • command whitelist and phase rejection
  • private atomic checkpoint round trip
  • timestamped complete-run recovery
  • targeted suite — 19 passed
  • full platform-neutral suite — 879 passed, 1 skipped
  • Python compile and diff checks pass

Made with Cursor

Reject implicit steering after goal anchoring, checkpoint complete turns privately, and recover exact Generator/Critic state from timestamped logs for safe restart continuation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@FluffyAIcode
FluffyAIcode merged commit 9b06a77 into main Jul 18, 2026
7 checks passed
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.

1 participant