fix(protocol): Migrate to JSON framing with newline delimiters (resolves desync)
Some checks failed
Deploy-Agent-V15-Stdin / JOB-V15-STDIN (push) Failing after 2s

This commit is contained in:
2026-04-19 20:23:27 -04:00
parent 8db786a33a
commit 499ef377e6
3 changed files with 43 additions and 43 deletions

View File

@@ -61,9 +61,9 @@ The CLI actuator writes the agent's response back to the client's network stream
(handler-case
(if (and stream (open-stream-p stream))
(progn
(format stream "~a" (frame-message (format nil "~s" (list :TYPE :CHAT :TEXT text))))
(format stream "~a" (frame-message (list :TYPE :CHAT :TEXT text)))
(finish-output stream)
(format stream "~a" (frame-message (format nil "~s" '(:TYPE :STATUS :SCRIBE :idle :GARDENER :sleeping))))
(format stream "~a" (frame-message '(:TYPE :STATUS :SCRIBE :IDLE :GARDENER :SLEEPING)))
(finish-output stream))
(harness-log "CLI ERROR: No active or open reply stream for signal."))
(error (c) (harness-log "CLI ACTUATOR ERROR: ~a" c)))))
@@ -77,7 +77,7 @@ Handles an individual TCP connection. It reads lines until the connection is clo
"Handles TUI slash commands by returning structured Lisp s-expressions."
(cond
((string= cmd "/status")
(format stream "~a" (frame-message (format nil "~s" '(:TYPE :STATUS :SCRIBE :idle :GARDENER :sleeping))))
(format stream "~a" (frame-message '(:TYPE :STATUS :SCRIBE :IDLE :GARDENER :SLEEPING)))
(finish-output stream))
((string= cmd "/exit")
(prin1 '(:TYPE :info :TEXT "Goodbye!") stream)
@@ -93,9 +93,9 @@ Handles an individual TCP connection. It reads lines until the connection is clo
(handler-case
(progn
;; 1. Send Handshake
(format stream "~a" (frame-message (format nil "~s" (make-hello-message "0.1.0"))))
(format stream "~a" (frame-message (make-hello-message "0.1.0")))
(finish-output stream)
(format stream "~a" (frame-message (format nil "~s" '(:TYPE :STATUS :SCRIBE :idle :GARDENER :sleeping))))
(format stream "~a" (frame-message '(:TYPE :STATUS :SCRIBE :IDLE :GARDENER :SLEEPING)))
(finish-output stream)
;; 2. Communication Loop