Skip to content

[Enhancement]: Show executionTimeout in code mode tool output #106

@spachava753

Description

@spachava753

Enhancement Category

Code mode improvements

Problem or Use Case

When the tool is in code mode, the execute_go_code tool is used to execute Go code generated by the LLM. This tool accepts an optional executionTimeout parameter (defaulting to 300s, but often set lower by the model or user intent).

Currently, internal/agent/response_printer.go explicitly formats the output for execute_go_code to show the Go code in a syntax-highlighted block. However, it ignores the executionTimeout parameter.

This means the user has no visibility into what timeout the LLM has requested for the execution. If a script is time-sensitive or long-running, not knowing the timeout can make debugging difficult (e.g., distinguishing between a hang and a pending timeout, or understanding why it was killed).

Proposed Solution

Modify internal/agent/response_printer.go in the renderToolCall method.

When handling codemode.ExecuteGoCodeToolName, it should:

  1. Check if executionTimeout is present in toolCall.Parameters.
  2. If present, display it in the output header or alongside the code block.

Example Output:

#### [tool call] (timeout: 60s)
```go
package main
// ...
```

Implementation Details:

  • Parse executionTimeout from the parameters map (it should be a float64 or int).
  • Format the string passed to g.contentRenderer.Render.

Alternatives Considered

We could print the full JSON for execute_go_code like other tools, but that would hurt readability for the code itself. The current special handling is good, it just needs to be more comprehensive.

Impact Scope

Users of specific AI providers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions