Skip to content

Conversation

@hanna-paasivirta
Copy link
Contributor

@hanna-paasivirta hanna-paasivirta commented Dec 18, 2025

Short Description

a) Adds read-only mode support to workflow_chat service for non-editable workflows (snapshots, historical versions). When read_only: true is set in the payload, the service switches to answering questions and providing guidance with YAML suggestions inline (triple-backticked) instead of in the yaml response key. Fixes workflow confusion when users view snapshots and receive model answers about edits that were not applied.

Fixes #344

b) Sneaks in a fix for #280 to tell the model not to create identical names for jobs.

Implementation Details

  • Adds read_only field to Payload dataclass (defaults to False). There are no breaking changes.
  • read-only mode can still output YAML suggestions, but these are inside a YAML block inside the answer text key. The model is instructed to keep the YAML key, but set it to None (this helps simplify the code). The user will see the suggestion even though editing is disabled, as the suggestion will be inside the chat.
  • read-only mode removes ID keys from existing YAMLs before sending to the LLM, so that the service does not return IDs that the user might copy into a new workflow where they might collide with another existing workflow. There is no YAML key in the model's output, so new IDs are not generated. References to IDs are removed in the prompt examples and instructions for consistency.
  • Refactored prompt building to handle the different modes more easily (normal, error, read-only)
  • Tests added for prompt building for each mode and a conversation turn in read-only mode

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

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.

Know when a workflow is in read-only mode

2 participants