Skip to content

feat: log the agent's tool calls while it runs - #31

Merged
PunGrumpy merged 3 commits into
mainfrom
feat/tool-call-log
Nov 16, 2026
Merged

PunGrumpy merged 3 commits into
mainfrom
feat/tool-call-log

Conversation

@PunGrumpy

@PunGrumpy PunGrumpy commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Description

While the agent works, the step log shows the working directory, the model, and the permissions, and then nothing until the run ends, which can take many minutes. You cannot tell whether the agent is reading the right files or looping, and after a bad answer you cannot see what it looked at.

The SDK already streams a tool_call event for every tool the agent uses, and the action was throwing them away. It now prints one line per call when the call finishes, such as read src/index.ts, grep TODO, or shell bun test. A call whose tool reports an error ends in failed. A shell command that exits non-zero still ran, so it does not. There is no new input. Arguments are cut to 160 characters, and file contents, edit bodies, and tool results are never printed.

Lines are printed on completion rather than at the start because the stream also reports a call as running while the model is still writing its arguments, so a start line could show a cut-off path or command. The cost is that a long shell command appears when it finishes.

The target of each tool comes from a lookup table checked against the arguments the SDK actually sends for each tool. A tool it does not know prints its name alone.

Related Issues

None.

Checklist

  • I've reviewed my code
  • I've written tests (skip if not applicable, e.g. .github/–only changes)
  • I've added a changeset when the change affects the published action or release notes (skip for .github/–only community or template updates)
  • I've updated the docs, if necessary

Screenshots (if applicable)

None.

Additional Notes

Proof: 13 tests in __tests__/progress.test.ts and one runner test (a call reported as running and then completed is logged once and stays out of the answer). The event lifecycle was traced in the @cursor/sdk 1.3.1 bundle: running for partial and started updates, one completed event per call with the full arguments, and failures only in result.status. A live smoke run on Ubuntu, Windows, and macOS (run 43787687683) printed shell printenv INPUT_API-KEY >/dev/null && echo SET || echo UNSET in the step log for the agent's one shell call.

@PunGrumpy PunGrumpy added the enhancement New feature or request label Nov 14, 2026
@changeset-bot

changeset-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c5e42cd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@pungrumpy/cursor-action Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cursor-action Ready Ready Preview Nov 14, 2026 7:00pm UTC

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f538f9a-05f6-4ff0-8af1-98c109247747
Commits

Reviewing files that changed from the base of the PR and between 5a6a403 and c5e42cd.

Files ignored due to path filters: 1

  • dist/index.mjs is excluded by !**/dist/**
Files selected for processing: 6

  • .changeset/tool-call-log.md
  • __tests__/progress.test.ts
  • __tests__/runner.test.ts
  • docs/content/behaviour.mdx
  • src/progress.ts
  • src/runner.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The SDK streams a tool_call event for every tool the agent uses, but nothing turns one into text a person can read. A lookup table from tool name to its target argument gives each call a short line such as 'read src/index.ts', collapses whitespace, caps long arguments, and prints each call once even though the SDK reports it several times.
The step log printed three lines and then nothing until the run ended, so a workflow author could not tell whether the agent was working, stuck, or reading the wrong files. The runner already receives a tool_call event for every tool, so it now prints one line per call as it starts.
…esult

The local stream never sets a tool_call status of "error"; a failed tool
shows up as a completed event whose result has status "error", so the
failed line could never print. Running events also include partial
updates the server sends while the model is still writing the arguments,
so the first one can carry a cut-off path or command. Logging the
completed event fixes both, and no call needs remembering any more.
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

Deployment failed for project cursor-action with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/pungrumpy?upgradeToPro=build-rate-limit

@PunGrumpy
PunGrumpy merged commit 37aa1e8 into main Nov 16, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant