fix(web): stamp explicit incomplete/stop_reason instead of UI prose matching #96

Merged
thabeta merged 2 commits from development_structured_incomplete_field into integration 2026-06-09 12:06:16 +00:00
Member

Summary

Replaces the UI's brittle prose-matching (isIncompleteReply() over ~8 hardcoded phrases) with an explicit incomplete (boolean) / stop_reason (string) field stamped by the server on every turn/job reply. The UI keys its Continue/Retry affordance off that field and falls back to the prose heuristic only when the field is absent (older daemon). Detection reuses existing server-side signals — no new prose matcher.

Closes #40

Changes

  • Server (proof_run.rs): new turn_incomplete_signal() — the single server-owned text fallback, reusing reply_indicates_incomplete_run() (no new phrases).
  • Server (session.rs): stamp incomplete/stop_reason on the synchronous message.send response and the chat.complete SSE event.
  • Engine (core.rs): stamp incomplete/stop_reason on the turn:end SSE event, matched against the engine-owned STEP_LIMIT_REPLY_MARKER; Err arm reports stop_reason: "error".
  • Server (contract.rs): stamp_incomplete_signal_into_details() derives the signal from the structured step-limit flag, then failure_kind, then the reply fallback; called at the proof/autonomy job-details persistence point and during subagent reconciliation (before failure_kind is cleared).
  • UI (store.ts): prefer the server field at all 3 call sites (trackJobUntilDone terminal, sync message.send return, turn:end SSE); isIncompleteReply() demoted to a documented legacy fallback. Regenerated production bundle.
  • Tests: 4 new unit tests covering turn_incomplete_signal() and stamp_incomplete_signal_into_details() (structured flag, failure_kind, clean run).

Test Results

cargo test -p hero_shrimp_server — 301 passed, 0 failed. cargo check -p hero_shrimp_engine -p hero_shrimp_server clean. vite build succeeded; tsc shows only pre-existing unrelated errors.

## Summary Replaces the UI's brittle prose-matching (`isIncompleteReply()` over ~8 hardcoded phrases) with an explicit `incomplete` (boolean) / `stop_reason` (string) field stamped by the server on every turn/job reply. The UI keys its Continue/Retry affordance off that field and falls back to the prose heuristic only when the field is absent (older daemon). Detection reuses existing server-side signals — no new prose matcher. ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_shrimp/issues/40 ## Changes - **Server (`proof_run.rs`)**: new `turn_incomplete_signal()` — the single server-owned text fallback, reusing `reply_indicates_incomplete_run()` (no new phrases). - **Server (`session.rs`)**: stamp `incomplete`/`stop_reason` on the synchronous `message.send` response and the `chat.complete` SSE event. - **Engine (`core.rs`)**: stamp `incomplete`/`stop_reason` on the `turn:end` SSE event, matched against the engine-owned `STEP_LIMIT_REPLY_MARKER`; `Err` arm reports `stop_reason: "error"`. - **Server (`contract.rs`)**: `stamp_incomplete_signal_into_details()` derives the signal from the structured step-limit flag, then `failure_kind`, then the reply fallback; called at the proof/autonomy job-details persistence point and during subagent reconciliation (before `failure_kind` is cleared). - **UI (`store.ts`)**: prefer the server field at all 3 call sites (`trackJobUntilDone` terminal, sync `message.send` return, `turn:end` SSE); `isIncompleteReply()` demoted to a documented legacy fallback. Regenerated production bundle. - **Tests**: 4 new unit tests covering `turn_incomplete_signal()` and `stamp_incomplete_signal_into_details()` (structured flag, `failure_kind`, clean run). ## Test Results `cargo test -p hero_shrimp_server` — 301 passed, 0 failed. `cargo check -p hero_shrimp_engine -p hero_shrimp_server` clean. `vite build` succeeded; `tsc` shows only pre-existing unrelated errors.
fix(web): stamp explicit incomplete/stop_reason instead of UI prose matching
Some checks failed
Verify / verify (push) Failing after 19s
Verify / verify (pull_request) Failing after 38s
3482b99ccc
Replace the UI's brittle prose-matching (isIncompleteReply over ~8 hardcoded
phrases) with an explicit incomplete/stop_reason field stamped by the server on
every turn/job reply. The UI keys its Continue/Retry affordance off that field
and falls back to the prose heuristic only when the field is absent (older
daemon). Detection reuses existing server signals — the structured step-limit
event, failure_kind, and a single server-owned reply_indicates_incomplete_run
fallback — so there is no new prose matcher.

#40
salmaelsoly force-pushed development_structured_incomplete_field from 3482b99ccc
Some checks failed
Verify / verify (push) Failing after 19s
Verify / verify (pull_request) Failing after 38s
to f6c9572a2d
All checks were successful
Verify / verify (pull_request) Successful in 12m47s
Verify / verify (push) Successful in 32m54s
2026-06-08 14:25:56 +00:00
Compare
Merge remote-tracking branch 'origin/integration' into development_structured_incomplete_field
All checks were successful
Verify / verify (push) Successful in 12m34s
Verify / verify (pull_request) Successful in 32m15s
0bfef5c1bb
# Conflicts:
#	crates/hero_shrimp_web/static/assets/app.C9ryv1Pi.js
#	crates/hero_shrimp_web/static/assets/app.CLFV4RoG.js
#	crates/hero_shrimp_web/static/assets/app.DsplZEWO.js
#	crates/hero_shrimp_web/static/index.html
thabeta merged commit 432df99bdb into integration 2026-06-09 12:06:16 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_shrimp!96
No description provided.