Skip to content

Comments

fix: multiline for yaml on share#1797

Open
abaez-pantheon wants to merge 1 commit intodocker:mainfrom
abaez-pantheon:push-wplxyovnsywy
Open

fix: multiline for yaml on share#1797
abaez-pantheon wants to merge 1 commit intodocker:mainfrom
abaez-pantheon:push-wplxyovnsywy

Conversation

@abaez-pantheon
Copy link
Contributor

@abaez-pantheon abaez-pantheon commented Feb 19, 2026

The following patch fixes a bug discovered on yaml marshaling when handling multiline input. Essentially, when pushing to an OCI artifact to an OCI complaint registry, the yaml for multiline indentation is removed. Causing issues with marshaling the yaml for usage.

Tested the change by working locally and sharing to an OCI registry for comparison.

@abaez-pantheon abaez-pantheon requested a review from a team as a code owner February 19, 2026 18:21
@dgageot
Copy link
Member

dgageot commented Feb 20, 2026

@abaez-pantheon do you have an example of case where the current code fails?

@abaez-pantheon
Copy link
Contributor Author

abaez-pantheon commented Feb 20, 2026

@dgageot I do! Sorry for not referencing prior. 😅

So when doing a cagent share push ./some.yaml <oci-ref>, the pull and run commands return the following:

version: "5"
agents:
  root:
    name: root
    model: pro-high
    description: Designs the software changes. Analyzes the user's request, understands the existing codebase, and creates a plan for the developer to implement. Uses the researcher to gather any necessary information.
    toolsets:
    - type: think
      remote:
        url: ""
      api_config: {}
    - type: filesystem
      remote:
        url: ""
      api_config: {}
    instruction: |
    You are an architect agent responsible for gathering user requirements and creating a development plan.

Notice the instruction multiline pipe string. The indention is lost and so an error on yaml parsing returns as if the line is not a string but a key with.

And on execution:

❯ cagent run $SOME_OCI_REF
looking for version in config file
[27:5] non-map value is specified
  24 |       path: .memory/mem_root.db
  25 |       api_config: {}
  26 |     instruction: |
> 27 |     You are an architect agent responsible for gathering user requirements and creating a development plan.
           ^

@abaez-pantheon abaez-pantheon force-pushed the push-wplxyovnsywy branch 4 times, most recently from b511f04 to 16e0109 Compare February 21, 2026 04:09
@dgageot
Copy link
Member

dgageot commented Feb 24, 2026

@abaez-pantheon sorry, I was slow to follow-up.

I don't totally understand the issue.

The yaml you're sharing doesn't look valid to me. Or is it? Or is it the pushing/pulling that corrupted it?

@dgageot
Copy link
Member

dgageot commented Feb 24, 2026

@abaez-pantheon I have tested pushing a valid yaml and when I pull it, it's still correct. What am I missing?

@abaez-pantheon
Copy link
Contributor Author

@dgageot the main issue that without using the yaml flow field tags for multiline, the formatting for multiline loses the spacing for the string. Here is an example on v1.25 using the golang_developer.yaml:

ex

@dgageot
Copy link
Member

dgageot commented Feb 24, 2026

@abaez-pantheon interesting. I have tried with your sample earlier and didn't have any issue. I just tried with golang_developer.yaml and did face the issue...

@abaez-pantheon
Copy link
Contributor Author

abaez-pantheon commented Feb 24, 2026

The yaml you're sharing doesn't look valid to me.

Right, the YAML shared was what was serialized through cagent share push and then pulled through the cagent share pull.

Or is it the pushing/pulling that corrupted it?

The issue seems to be on serialization on the multiline string. Once uploaded to the container registry, in the incorrect format, cagent is not able to be read. But if serialized correctly, then no issue.

ex

Here's another recording going through the steps. I tried first by using my patch version of the yaml flow field tag. Then validating the yaml is correct. After, used the latest release version of cagent to also show correctly serialized uploaded yaml is still handled correctly. But once using the latest version, that same file ended up with the incorrect formatting.

Hope this helps.

@dgageot
Copy link
Member

dgageot commented Feb 25, 2026

Thanks a lot @abaez-pantheon for digging this issue. I think I've got a fix here: #1844

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.

2 participants