Skip to content

Approval card shows Python repr for list arguments that contain objects #90

Open

Description

@RaphaelFakhri

The confirm_write approval card renders each tool argument through summarize_args in agent/write_confirmation.py. A top-level object becomes compact JSON and a top-level boolean becomes Yes or No, but items inside a list go through str(). A list of objects therefore shows Python's repr on the card.

Steps to reproduce

from write_confirmation import summarize_args

summarize_args({"pages": [{"title": "Q3 plan"}], "flags": [True, False]})

Expected result

[{'label': 'Pages', 'value': '{"title": "Q3 plan"}'}, {'label': 'Flags', 'value': 'Yes, No'}]

Actual result

[{'label': 'Pages', 'value': "{'title': 'Q3 plan'}"}, {'label': 'Flags', 'value': 'True, False'}]

This affects any write whose arguments include a list of objects, for example the pages argument when creating Notion pages or the links of a Linear issue. The approver sees Python syntax where the rest of the card uses JSON and Yes/No.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions