* fix(agent-task): resolve Copilot API URL dynamically
Query viewer.copilotEndpoints.api to get the correct Copilot API URL
for the user's host instead of hardcoding api.githubcopilot.com. This
fixes 401 errors for ghe.com tenancy users whose Copilot API lives at
a different endpoint.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Simplified and clarified comments in the stripDiffFormat function to improve readability and maintainability. No functional changes were made to the code.
Replaces manual string splitting with filepath.Ext for determining the file extension in renderFileContentAsMarkdown. This improves accuracy, especially for files with multiple dots in their names.
Refactors log rendering to print errors to stderr and continue processing on JSON parse or rendering failures, instead of returning early. Updates tests to check both stdout and stderr outputs, and adds new test cases and testdata for tolerant parsing and error scenarios.
Shell commands in log output are now prefixed with '$ ' for improved readability and consistency with common shell output conventions. Updated related test data and test helper comments to reflect this change.
Moved the genericToolCallNamesToTitles map from inside the renderGenericToolCall function to a package-level variable for improved readability and potential reuse. This change also updates the function signature order for consistency.
Uncomments and activates support for Bash session tool calls (write_bash, read_bash, stop_bash, async_bash, read_async_bash, stop_async_bash) in the renderLogEntry function. Also defines the corresponding argument structs, enabling proper handling and display of these tool calls in the log output.
Renamed sample log input and expected output files in testdata to use a consistent 'log-*-input.txt' and 'log-*-want.txt' naming scheme. Updated references in log_test.go to match the new file names for improved clarity and maintainability.
A comment was added to TestFollow with instructions on how to update the .want testdata files when test outputs change. This helps maintainers regenerate expected output files more easily.
Added and expanded Go doc comments for multiple functions in pkg/cmd/agent-task/shared/log.go to clarify their purpose and usage. Also refactored renderToolCallTitle and related logic for improved naming consistency and robustness.
Refactors the function renderToolCall to renderToolCallTitle and updates all its usages for clarity. This improves function naming to better reflect its purpose of rendering tool call titles.
Refactored the function name from relativePath to relativeFilePath for clarity and updated all usages accordingly in log rendering functions. Also improved comments in stripDiffFormat for better context.
Renamed renderMarkdownWithPadding to renderMarkdownWithFormat and related variables for clarity. Updated comments and TODOs for better context on GUI support and code behavior.
Enhances log rendering by stripping diff formatting from viewed file content and improving JSON rendering with optional labels. Expands the list of recognized tool calls with descriptive titles, especially for Playwright and GitHub MCP server tools. Refactors related helper functions for clarity and robustness.
Extracted JSON content rendering into a new helper function renderContentAsJSONMarkdown for reuse. Updated 'report_progress' and 'create' tool call handling to use this helper, improving code clarity and reducing duplication. Also added support for rendering PR descriptions in 'report_progress' tool calls.
Updated the LogRenderer interface and implementations to accept *iostreams.IOStreams instead of *iostreams.ColorScheme, enabling access to terminal theme and width for improved markdown rendering. Refactored related code, tests, and mocks to support this change, and enhanced log rendering to better handle markdown and code output for various tool calls.
Moved the session state color selection logic from list.go to a new shared/display.go file as ColorFuncForSessionState. This improves code reuse and maintainability by centralizing the color mapping for session states.