Skip to content

Conversation

@dprevoznik
Copy link
Contributor

@dprevoznik dprevoznik commented Dec 17, 2025

Summary

  • Fixes pretty-printed kernel invoke output escaping & as \\u0026 (and similarly <, >), which breaks copy/paste of URLs returned in invocation output (e.g. replay URLs).
  • Switches JSON pretty-printing to a custom encoder with SetEscapeHTML(false).

Why

Go's default json.MarshalIndent escapes HTML-sensitive characters. When the CLI re-marshals invocation output for pretty printing, URLs like ...?jwt=...&replay_id=... can show up as ...?jwt=...\\u0026replay_id=....

Test plan

  • go test ./...

Note

Prevents HTML character escaping in pretty-printed invoke results by using a custom JSON encoder to preserve URL characters.

  • CLI – cmd/invoke.go:
    • Use custom JSON encoder for printResult with SetEscapeHTML(false) and indentation to avoid escaping &, <, > in pretty-printed output; trims trailing newline.

Written by Cursor Bugbot for commit f3502a4. This will update automatically on new commits. Configure here.

Go's json.MarshalIndent escapes '&' (and <, >) as unicode sequences like \u0026. This breaks copy/paste of URLs returned in invocation output (e.g. browser replay URLs).

Use a JSON encoder with SetEscapeHTML(false) when pretty-printing invocation output.
@dprevoznik dprevoznik marked this pull request as draft December 17, 2025 14:29
@dprevoznik
Copy link
Contributor Author

Example of running locally with the fix:

/Users/dprevoznik/Documents/GitHub/cli/bin/kernel invoke python-openagi-cua openagi-default-task -p '{"instruction": "Navigate to https://agiopen.org and click the What is Computer Use? button", "record_replay": "True"}'

And the result with the correct replay URL:

INFO  Destroying browser session: hhy7qf2sa6jlp736wwkf0tz8
 INFO  Browser session destroyed.
 SUCCESS  Result:
          {
            "replay_url": "https://proxy.iad-delightful-dickinson.onkernel.com:8443/browser/replays?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3OTc1MTgzMTAsInNlc3Npb24iOnsiaWQiOiJoaHk3cWYyc2E2amxwNzM2d3drZjB0ejgiLCJjZHBQb3J0Ijo5MjIyLCJjZHBXc1BhdGgiOiIiLCJpbnN0YW5jZU5hbWUiOiJicm93c2VyLXN0ZWFsdGgtcHJvZHVjdGlvbi0xMjE4LXByZXNlbnQtbGVzdGVyLTI0MCIsImZxZG4iOiJsb25nLWdyYXNzLXpsOWg1ZmY4LnByb2QtaWFkLXVuaWtyYWZ0LTUub25rZXJuZWwuYXBwIiwibWV0cm8iOiJodHRwczovL2FwaS5wcm9kLWlhZC11bmlrcmFmdC01Lm9ua2VybmVsLnJ1bi92MSIsInVzZXJJZCI6Inc4N2g0d3V1NGhrM2Z4cXJlbmI3MWsycCIsIm9yZ0lkIjoiaXEydGYyNTNtaWw5am05aGZmMjdsOHIyIiwic3RlYWx0aCI6dHJ1ZSwiaGVhZGxlc3MiOmZhbHNlLCJyZXBsYXlQcmVmaXgiOiJzMzovL2tlcm5lbC1hcGktcHJvZC9zZXNzaW9ucmVwbGF5cy9pcTJ0ZjI1M21pbDlqbTloZmYyN2w4cjIvaGh5N3FmMnNhNmpscDczNnd3a2YwdHo4Iiwia2VybmVsSHR0cFNlcnZlclBvcnQiOjQ0NCwidGltZW91dFNlY29uZHMiOjMwMCwiY3JlYXRlZEF0IjoiMjAyNS0xMi0xN1QxNDozODozMC4wMzc4NDk4OTFaIiwiaW1hZ2UiOiJvbmtlcm5lbC9rZXJuZWwtY3UtdjI0OjQwOGJjZDEiLCJzdGVhbHRoUHJveHlJZGVudGlmaWVyIjoiODc1NjVfblhERkZAMjA0LjI0Mi4xNzYuNjg6NjEyMzQiLCJsaXZlU2x1ZyI6IkpFTDF5YmZtMFBHZCIsInByaXZhdGVJUCI6IjE3Mi4xNi4xLjczIn19.zXw8bHB4sGRjyytIsUWQsRvYObjARB7wzuPUcHIjr2k&replay_id=vwfvxbb0e59z31xpivdkjaqd",
            "result": "Task completed with model lux-actor-1. Success: False",
            "success": false
          }
 SUCCESS  ✔ Completed in 1m10.253s

@dprevoznik dprevoznik marked this pull request as ready for review December 17, 2025 14:43
@dprevoznik dprevoznik merged commit 91cafac into main Dec 17, 2025
2 checks passed
@dprevoznik dprevoznik deleted the fix/invoke-url-encoding branch December 17, 2025 18:28
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.

3 participants