FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Python: Declarative concatenation treats quoted expressions as literal text · Issue #9072 · microsoft/agent-framework · GitHub

Repository navigation

Python: Declarative concatenation treats quoted expressions as literal text #9072

Description

Description

Declarative workflows treat a concatenation argument as literal text whenever it starts and ends with a double quote. A valid expression such as "a" & "b" is therefore emitted as source text instead of evaluated. Escaped double quotes inside a string are also left doubled.

This affects Concatenate and the declarative runtime's string Concat alias. For example:

Formula Expected output Actual output
Concatenate("a" & "b", "c") abc a" & "bc
Concatenate("a""b", "c") a"bc a""bc
Concatenate("plain", "text") plaintext plaintext

Code Sample

import asyncio

from agent_framework_declarative import WorkflowFactory


async def main():
    workflow = WorkflowFactory().create_workflow_from_definition({
        "name": "concat_repro",
        "actions": [{
            "kind": "SendActivity",
            "id": "show",
            "activity": {"text": '=Concatenate("a" & "b", "c")'},
        }],
    })
    events = await workflow.run({})
    print(events.get_outputs())  # Expected: ['abc']; actual: ['a" & "bc']


asyncio.run(main())

Error Messages / Stack Traces

No exception is raised; the workflow emits incorrect text.

Package Versions

Source checkout 636e8562d1db4e678e0bb88f602e0bbc7318f6a4: agent-framework-declarative 1.2.0 and agent-framework-core 1.20.0; powerfx 0.0.34.

Python Version

Python 3.12.14 on Windows x64.

Additional Context

The same expressions evaluated directly by the installed PowerFx engine return the expected strings. The PowerFx concatenation documentation describes evaluation of the string arguments and equivalence with the & operator.

I am working on a focused fix with workflow-level regressions. It will distinguish a complete quoted literal from an expression, decode doubled quotes, and preserve the existing literal-only path when PowerFx is unavailable. No external model or service is needed for this reproduction.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

pythonUsage: [Issues, PRs], Target: Python

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL