Skip to content

[upstream/eca] State machine race on promptStop #3

@ssjoleary

Description

@ssjoleary

Note: This is a server-side bug (lives in editor-code-assistant/eca, not eca-nvim). Tracked here for our own visibility.

Where

eca/src/eca/features/chat/tool_calls.clj:480 in transition_tool_call_BANG_

Symptom

Invalid state transition exception logged after chat/promptStop:

:current-status :cleanup
:event :tool-prepare
:valid-events (:cleanup-finished :stop-requested)

Why

Anthropic stream delivers :tool-prepare chunks after server enters :cleanup state. The state machine rejects them.

Fix (upstream)

Either:

  • Silently discard tool-prepare events during :cleanup state, or
  • Add :tool-prepare to valid-events set for that transition

Impact

Cosmetic — stop still works. Just noisy exceptions in server logs.

Found

During manual testing of editor-code-assistant#63 (chat/promptStop implementation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions