Skip to content

Comments

Diagnostic files copying#7209

Merged
DOsinga merged 1 commit intomainfrom
copy-diagnostics-files
Feb 13, 2026
Merged

Diagnostic files copying#7209
DOsinga merged 1 commit intomainfrom
copy-diagnostics-files

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Feb 13, 2026

Summary

Hitting c now copies the current file - prettifies json for response/requests

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a copy-to-clipboard feature for the diagnostics viewer, allowing users to press 'c' to copy the currently displayed file with automatic JSON pretty-formatting for request/response data.

Changes:

  • Added tracking of current filename and part (request/responses) in FileViewer
  • Added 'c' keyboard binding to copy current file content with JSON formatting

Comment on lines +543 to +549
try:
responses = [json.loads(line) for line in lines[1:]]
if len(responses) == 1:
content = json.dumps(responses[0], indent=2)
else:
content = json.dumps(responses, indent=2)
except json.JSONDecodeError:
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list comprehension will fail if any response line has invalid JSON, causing the entire operation to fall back to copying raw text. This is inconsistent with _show_jsonl (lines 344-349) which parses responses individually and skips malformed lines. Consider using a similar approach: iterate through lines[1:] with individual try-except blocks to collect only valid responses, matching the viewing behavior.

Suggested change
try:
responses = [json.loads(line) for line in lines[1:]]
if len(responses) == 1:
content = json.dumps(responses[0], indent=2)
else:
content = json.dumps(responses, indent=2)
except json.JSONDecodeError:
responses = []
for line in lines[1:]:
try:
responses.append(json.loads(line))
except json.JSONDecodeError:
# Skip malformed JSON lines to match _show_jsonl behavior
continue
if responses:
if len(responses) == 1:
content = json.dumps(responses[0], indent=2)
else:
content = json.dumps(responses, indent=2)
else:

Copilot uses AI. Check for mistakes.
try:
data = json.loads(content)
content = json.dumps(data, indent=2)
except json.JSONDecodeError:
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'except' clause does nothing but pass and there is no explanatory comment.

Suggested change
except json.JSONDecodeError:
except json.JSONDecodeError:
# If content is not valid JSON, fall back to copying it as-is.

Copilot uses AI. Check for mistakes.
@DOsinga DOsinga added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit f09ad21 Feb 13, 2026
24 checks passed
@DOsinga DOsinga deleted the copy-diagnostics-files branch February 13, 2026 14:00
katzdave added a commit that referenced this pull request Feb 13, 2026
…ntext

* 'main' of github.com:block/goose:
  feat: add onFallbackRequest handler to McpAppRenderer (#7208)
  feat: add streaming support for Claude Code CLI provider (#6833)
  fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885)
  Add prompts (#7212)
  Add testing instructions for speech to text (#7185)
  Diagnostic files copying (#7209)
  fix: allow concurrent tool execution within the same MCP extension (#7202)
  fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143)
  Filter Apps page to only show standalone Goose Apps (#6811)
  opt: use static for Regex (#7205)
  nit: show dir in title, and less... jank (#7138)
  feat(gemini-cli): use stream-json output and re-use session (#7118)
  chore(deps): bump qs from 6.14.1 to 6.14.2 in /documentation (#7191)
  Switch jsonwebtoken to use aws-lc-rs (already used by rustls) (#7189)
  chore(deps): bump qs from 6.14.1 to 6.14.2 in /evals/open-model-gym/mcp-harness (#7184)
  Add SLSA build provenance attestations to release workflows (#7097)
  fix save and run recipe not working (#7186)
  Upgraded npm packages for latest security updates (#7183)
  docs: reasoning effort levels for Codex provider (#6798)
michaelneale added a commit that referenced this pull request Feb 16, 2026
* origin/main: (42 commits)
  fix: use dynamic port for Tetrate auth callback server (#7228)
  docs: removing LLM Usage admonitions (#7227)
  feat(otel): respect standard OTel env vars for exporter selection (#7144)
  fix: fork session (#7219)
  Bump version numbers for 1.24.0 release (#7214)
  Move platform extensions into their own folder (#7210)
  fix: ignore deprecated skills extension (#7139)
  Add a goosed over HTTP integration test, and test the developer tool PATH (#7178)
  feat: add onFallbackRequest handler to McpAppRenderer (#7208)
  feat: add streaming support for Claude Code CLI provider (#6833)
  fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885)
  Add prompts (#7212)
  Add testing instructions for speech to text (#7185)
  Diagnostic files copying (#7209)
  fix: allow concurrent tool execution within the same MCP extension (#7202)
  fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143)
  Filter Apps page to only show standalone Goose Apps (#6811)
  opt: use static for Regex (#7205)
  nit: show dir in title, and less... jank (#7138)
  feat(gemini-cli): use stream-json output and re-use session (#7118)
  ...
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