Skip to content

Conversation

@tlongwell-block
Copy link
Collaborator

Problem

The daily test-finder workflow was missing the developer extension, which is required for Goose to:

  • Edit source files to add tests
  • Run cargo test to verify tests pass
  • Apply fixes when tests fail

Without this extension, Goose cannot fulfill its core purpose in this workflow.

Solution

  1. Enable developer extension: Added --with-builtin developer flag to the goose run command
  2. Add usage metrics: Extract and display token usage in PR descriptions for cost visibility

Changes

  • ✅ Minimal change to enable developer extension (1 flag addition)
  • 📊 Added token metrics extraction step
  • 📈 Display metrics in PR body (total, input, output tokens)

Technical Details

  • The session file is stored at a known path within the container's session directory
  • Metrics are extracted from the JSONL metadata using jq (already installed)
  • Gracefully handles missing session files without failing the workflow

Benefits

  • Fixes core functionality: Goose can now actually create and test code
  • Cost transparency: Each PR shows exactly how many tokens were used
  • Usage tracking: Helps optimize prompts and monitor AI resource consumption
  • No breaking changes: Fully backward compatible

Testing

  • Verified --with-builtin flag syntax locally
  • Confirmed session path must be within goose session directory
  • Checked that jq is already installed in the workflow

@tlongwell-block
Copy link
Collaborator Author

Looking at this PR now to assess if it will work correctly...

@tlongwell-block tlongwell-block merged commit 7a1d45d into main Sep 17, 2025
11 checks passed
@tlongwell-block tlongwell-block deleted the test_ci_enhancement branch September 17, 2025 15:19
@alexhancock alexhancock mentioned this pull request Sep 23, 2025
HikaruEgashira pushed a commit to HikaruEgashira/goose that referenced this pull request Oct 3, 2025
…trics (block#4661)

Signed-off-by: HikaruEgashira <hikaru-egashira@c-fo.com>
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