Skip to content

How to copy code from AI response? #8682

Open

Description

@hhvu0102

What happened?

Hi team,

Not sure if this is a bug or a feature request. Copy and paste AI code didn't work for me (see screenshot), as the code when pasted became some sort of json (?) text (not sure how to describe it, please see screenshot). Thanks for your help!

Image

How to reproduce?

Open any AI response (Claude Sonet 4.6) on dknet-ai.org, copy and paste to a different text file or a code content box.

Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

No response

What browsers are you seeing the problem on?

No response

Relevant log output

Activity

  1. added theissue type on Sep 25, 2026
  2. Ma77Ball commented on Sep 25, 2026

    @Ma77Ball
    Contributor

    @hhvu0102 I don't think you are meant to manually use that code; the agent is meant to build a workflow for you. I also think this might be related to one of the releases. @aicam / @kunwp1 any comments? I'm not too familiar with the agent on DKNET.

  3. hhvu0102 commented on Sep 25, 2026

    @hhvu0102
    Author

    I wanted to review the bot's suggestions before it edits the code, because sometimes it edits to be worse... Perhaps you can enable manual approval for the bot, though I'm not sure how feasible it is.

  4. kunwp1 commented on Sep 25, 2026

    @kunwp1
    Contributor

    Question for @aicam for the public dKNET server?

  5. Ma77Ball commented on Sep 25, 2026

    @Ma77Ball
    Contributor

    That is a great suggestion. It is very doable and has been done in some past experiments. I'm not sure if another committer has raised a pr on this. Possibly @bobbai00 might know.

  6. CaroFernando commented on Sep 29, 2026

    @CaroFernando
    Contributor

    Since the text was copied from the chat bubble, my guess is the JSON was part of the agent's message itself: it looks like the payload the agent uses internally to modify the workflow (applied automatically, not meant for manual use), just surfaced as a code block, which is understandably confusing.

    The review-before-apply idea from earlier in this thread seems like the right direction, and might address both halves at once: proposed edits could arrive in the chat as an Approve/Reject card showing a plain-language before and after summary of the workflow, so there's no raw JSON to interpret, and nothing lands until approved. Read-only actions (viewing operators, checking schemas) would probably still run automatically, so it's not an approval prompt every step. It would touch both the agent service and the UI, so it's likely a staged series rather than one PR.

    @bobbai00, Ma77Ball mentioned past experiments in this direction; is there existing work to build on?

    @hhvu0102, one check that could confirm this diagnosis: the Export button in the chat toolbar (top right) dumps the steps as JSON; the content field of the step that was copied from would tell us what that block actually is.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions