Skip to content

[Ford] Published to a Workflow's own stream from Workflow code. - #164

Closed
moetemp wants to merge 7 commits into
moe/ford/w1-worker-stream-storefrom
moe/ford/w2-workflow-writer
Closed

moetemp wants to merge 7 commits into
moe/ford/w1-worker-stream-storefrom
moe/ford/w2-workflow-writer

Conversation

@moetemp

@moetemp moetemp commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds workflow_writer(), whose records ride the completion of the activation that published them.

  • WorkflowStreamWriter has publish(value) and finish(). FINISH is idempotent per topic, and a publish after it is refused.
  • Each value is converted and hashed on the Workflow thread into one WorkflowOutputStreamCommit command. A failed activation drops it with the completion.
  • Core appends the records when the activation completes, before the Workflow Task completes, as the run's producer @<run id>, and writes the marker. If the task fails, the records stay, and its rerun publishes again under the run's next attempt, which readers see as SUPERSEDED.
  • A body holds at most 1.5 MiB and an activation at most 16 MiB. The publish that crosses either raises StreamError at the call. A query or an Update validator can't publish.
  • The plugin adds an interceptor that tells Workflow code the Worker has a store. workflow_activity_writer stays, so a Workflow can still publish through an Activity.

Why?

A Workflow that runs model and tool calls as Local Activities in one long Workflow Task must show each record when it is published, not when the task ends. Core owns the append and the marker, so lang hands over records and keeps no manifest or History read (DD-87).

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

tests/contrib/streams/test_workflow_writer.py runs on the dev server and reads through Core's stream service.

Core appends them as the run's producer then. A failed task's rerun
publishes again under the next attempt.
@moetemp moetemp changed the title [Ford] Committed a Workflow's stream records with its task. [Ford] Published to a Workflow's own stream from Workflow code. Oct 13, 2026
@moetemp moetemp added the parked Parked design, not for review label Oct 14, 2026
@moetemp

moetemp commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

Closed. The Ford project (Core Workflow Task publish) is dropped. Brook now publishes from a Workflow through a local activity, with no Core change. Bridge moves onto Brook in the coming Jetty re-cut. This branch stays until then, because Bridge PRs still sit on it.

@moetemp moetemp closed this Oct 14, 2026
@moetemp
moetemp deleted the moe/ford/w2-workflow-writer branch October 14, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parked Parked design, not for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant