docs(ai-chat): align requestStop JSDoc with abort-first order (F17)

The method docstring still described the old write-then-abort order and
presented the stop_requested_at stamp as guaranteed. Reword to: abort first
(the only thing that actually stops the run), then best-effort stamp that may
be skipped on a DB error or lost to the finalize race — acceptable since the
row still settles as 'aborted'.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
claude code agent 227
2026-06-29 15:38:55 +03:00
parent 2916c13591
commit 7043e08353

View File

@@ -378,8 +378,11 @@ export class AiChatRunService implements OnModuleInit {
/**
* Request an EXPLICIT stop of a run (the user pressed Stop). This is the ONLY
* thing that aborts a run — distinct from a browser disconnect, which leaves
* the run going. Records `stop_requested_at` on the row (only while active) and
* aborts the in-process controller if this replica owns the run. Returns true
* the run going. Aborts the in-process controller FIRST (the only thing that
* actually stops the run, if this replica owns it), then makes a best-effort
* attempt to stamp `stop_requested_at` — that audit write stamps only while the
* row is active and may be skipped on a DB error or lost to the finalize race,
* which is acceptable since the row still settles as 'aborted'. Returns true
* when a stop took effect (row marked and/or controller aborted), false when
* there was nothing active to stop.
*/