Skip to content

Global assistant: send a full workflow YAML only for multistep changes#547

Open
hanna-paasivirta wants to merge 19 commits into
mainfrom
global-chat-multistep
Open

Global assistant: send a full workflow YAML only for multistep changes#547
hanna-paasivirta wants to merge 19 commits into
mainfrom
global-chat-multistep

Conversation

@hanna-paasivirta

@hanna-paasivirta hanna-paasivirta commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

DO NOT MERGE

Until OpenFn/lightning#4888 is in lightning prod

Short Description

This changes the Global Assistant payload to always return a single full workflow YAML, instead of a YAML plus separate job code. This lets one conversation turn apply code changes across several steps.

This is a breaking change in the Global Assistant. It must be coordinated with Lightning: OpenFn/lightning#4888.

The PR also bundles a series of routing, tool, and prompt improvements to the Global Assistant.

Fixes #507.

Implementation Details

Payload

  • Responses now carry one workflow_yaml attachment with the full workflow, with any generated job code already stitched in. There is no separate job-code artifact.
  • A single source of truth lets the planner change structure and several job bodies in the same turn, then return one coherent YAML.

Planner

  • Adaptor selection is delegated to the workflow subagent. The planner describes which systems to connect and no longer names adaptors. It had no adaptor list and was picking the wrong ones.
  • "Add a step" requests are split by intent. A vague request adds the step only and asks what it should do. A specific request also fills in the code via the job subagent.
  • Added self-correction. If a subagent reply shows the wrong tool was used (for example it cannot see job code), the planner re-routes instead of passing the message to the user.
  • Returned history now uses plain string content, matching the direct routes, instead of raw tool-call blocks. This keeps all three agents consistent and removes a latent replay crash.
  • Raised the max tool calls from 10 to 25 so larger workflows are not cut off mid-build.

Router

  • Clarified the subagent roles. Structural edits go to the workflow agent, code goes to the job agent, and anything needing both, multiple steps, or another step as a reference goes to the planner. The job agent only ever sees one step, so requests that read or touch other steps must use the planner.
  • "What does my workflow do" now routes on whether the steps contain code. It goes to the planner when they do, so the real code can be read, and to the workflow agent when they are empty, which is faster.

Docs and tests

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

dependabot Bot added 2 commits June 23, 2026 19:59
Bumps [pydantic-settings](https://github.com/pydantic/pydantic-settings) from 2.14.0 to 2.14.2.
- [Release notes](https://github.com/pydantic/pydantic-settings/releases)
- [Commits](pydantic/pydantic-settings@v2.14.0...v2.14.2)

---
updated-dependencies:
- dependency-name: pydantic-settings
  dependency-version: 2.14.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [langsmith](https://github.com/langchain-ai/langsmith-sdk) from 0.8.1 to 0.8.18.
- [Release notes](https://github.com/langchain-ai/langsmith-sdk/releases)
- [Commits](langchain-ai/langsmith-sdk@v0.8.1...v0.8.18)

---
updated-dependencies:
- dependency-name: langsmith
  dependency-version: 0.8.18
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@hanna-paasivirta hanna-paasivirta marked this pull request as ready for review June 24, 2026 17:02
@hanna-paasivirta hanna-paasivirta changed the title Global chat multistep Global assistant: send a full workflow YAML only for multistep changes Jun 25, 2026
@hanna-paasivirta

Copy link
Copy Markdown
Contributor Author

@josephjclark Let us know if you want @elias-ba to review this

@josephjclark josephjclark force-pushed the global-chat-multistep branch from 60fb859 to cc8a9b2 Compare June 26, 2026 09:37
Bumps the python-minor-patch group with 9 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [openai](https://github.com/openai/openai-python) | `2.41.1` | `2.44.0` |
| [anthropic](https://github.com/anthropics/anthropic-sdk-python) | `0.109.1` | `0.112.0` |
| [langchain-core](https://github.com/langchain-ai/langchain) | `1.4.6` | `1.4.8` |
| [langchain-openai](https://github.com/langchain-ai/langchain) | `1.3.0` | `1.3.3` |
| [pytest](https://github.com/pytest-dev/pytest) | `9.0.3` | `9.1.1` |
| [sentry-sdk](https://github.com/getsentry/sentry-python) | `2.62.0` | `2.63.0` |
| [langfuse](https://github.com/langfuse/langfuse) | `4.7.1` | `4.12.0` |
| [opentelemetry-instrumentation-threading](https://github.com/open-telemetry/opentelemetry-python-contrib) | `0.63b1` | `0.64b0` |
| [ruff](https://github.com/astral-sh/ruff) | `0.15.17` | `0.15.20` |



Updates `openai` from 2.41.1 to 2.44.0
- [Release notes](https://github.com/openai/openai-python/releases)
- [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md)
- [Commits](openai/openai-python@v2.41.1...v2.44.0)

Updates `anthropic` from 0.109.1 to 0.112.0
- [Release notes](https://github.com/anthropics/anthropic-sdk-python/releases)
- [Changelog](https://github.com/anthropics/anthropic-sdk-python/blob/main/CHANGELOG.md)
- [Commits](anthropics/anthropic-sdk-python@v0.109.1...v0.112.0)

Updates `langchain-core` from 1.4.6 to 1.4.8
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](langchain-ai/langchain@langchain-core==1.4.6...langchain-core==1.4.8)

Updates `langchain-openai` from 1.3.0 to 1.3.3
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](langchain-ai/langchain@langchain-openai==1.3.0...langchain-openai==1.3.3)

Updates `pytest` from 9.0.3 to 9.1.1
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@9.0.3...9.1.1)

Updates `sentry-sdk` from 2.62.0 to 2.63.0
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-python@2.62.0...2.63.0)

Updates `langfuse` from 4.7.1 to 4.12.0
- [Release notes](https://github.com/langfuse/langfuse/releases)
- [Commits](https://github.com/langfuse/langfuse/commits)

Updates `opentelemetry-instrumentation-threading` from 0.63b1 to 0.64b0
- [Release notes](https://github.com/open-telemetry/opentelemetry-python-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-python-contrib/commits)

Updates `ruff` from 0.15.17 to 0.15.20
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.15.17...0.15.20)

---
updated-dependencies:
- dependency-name: openai
  dependency-version: 2.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-minor-patch
- dependency-name: anthropic
  dependency-version: 0.112.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-minor-patch
- dependency-name: langchain-core
  dependency-version: 1.4.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-minor-patch
- dependency-name: langchain-openai
  dependency-version: 1.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: python-minor-patch
- dependency-name: pytest
  dependency-version: 9.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-minor-patch
- dependency-name: sentry-sdk
  dependency-version: 2.63.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-minor-patch
- dependency-name: langfuse
  dependency-version: 4.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: python-minor-patch
- dependency-name: opentelemetry-instrumentation-threading
  dependency-version: 0.64b0
  dependency-type: direct:production
  dependency-group: python-minor-patch
- dependency-name: ruff
  dependency-version: 0.15.20
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: python-minor-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@josephjclark

Copy link
Copy Markdown
Collaborator

Yes, this is a breaking change and is incompatible with older lightning versions.

But we can release this as soon as OpenFn/lightning#4888 is live

…-7e6f6a277e

Bump the python-minor-patch group across 1 directory with 9 updates
…2.14.2

Bump pydantic-settings from 2.14.0 to 2.14.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Global chat: Applying job code changes across several steps

2 participants