Skip to content

Refused a stream publish from a query handler at the call. - #36

Open
moedash wants to merge 2 commits into
moe/AI-198-if-py-10-backwards-attempt-warningfrom
moe/AI-198-if-py-11-query-publish-refusal
Open

moedash wants to merge 2 commits into
moe/AI-198-if-py-10-backwards-attempt-warningfrom
moe/AI-198-if-py-11-query-publish-refusal

Conversation

@moedash

@moedash moedash commented Oct 3, 2026

Copy link
Copy Markdown
Owner

This PR makes StreamWriter.publish raise ReadOnlyContextError when it's called from a query handler or an update validator.

What changed?

  • StreamWriter.publish checks workflow_is_read_only() before handing the record to the provider, and raises the same error other read-only violations raise.
  • A workflow case shows that a query that publishes gets the error, and that the stream stays empty.

Part of AI-198 (epic AI-37).

Why?

A query task commits only its answer. A record published there could only be dropped later, without a word. It's better to fail at the call, where the mistake is. The external mirror of this interface already carried this fix. It lands here so both chains behave the same.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

poe lint is clean. The workflow stream cases pass on the memory provider against the dev server the fixtures start, the new query case included.

A query task commits only its answer, so the record could only be dropped later without a word. Raising ReadOnlyContextError says so at the call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Changelog entry rides another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant