Skip to content

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Nov 7, 2025

Summary

Fix the naming in the custom extensions

@DOsinga DOsinga requested review from alexhancock and Copilot and removed request for Copilot November 7, 2025 15:42
Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

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

we could get a lot fancier here, drawing something more useful from the various ways you might have npx -y the-extension --foo --bar but no need to overdo it

Copilot AI review requested due to automatic review settings November 7, 2025 16:17
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 refactors the extension name generation logic by extracting duplicated code into a new generate_extension_name function. The new function creates more descriptive extension names based on the command or URL, rather than purely random strings.

Key changes:

  • Added generate_extension_name function that creates semi-descriptive names using a prefix from the extension command/URL plus a random suffix
  • Replaced three instances of random name generation with calls to the new function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +147 to +155
let prefix: String = cmd_name.chars().take(16).collect();

let random_suffix: String = rand::thread_rng()
.sample_iter(&Alphanumeric)
.take(8)
.map(char::from)
.collect();

let name = format!("{}_{}", prefix, random_suffix);
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

If cmd_name is empty (which occurs when the input contains only non-alphanumeric characters), prefix will be empty. This leads to name being just _{random_suffix}, which starts with an underscore. The subsequent alphabetic check on line 157 will then prepend 'g', resulting in names like g_abc12345. This creates inconsistent naming where empty prefixes get 'g_' but valid prefixes don't. Consider handling the empty cmd_name case explicitly before formatting the name.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

eh, what? that's exactly how it is supposed to work

@DOsinga DOsinga merged commit 6b17d81 into main Nov 7, 2025
22 checks passed
katzdave added a commit that referenced this pull request Nov 7, 2025
…eanup

* 'main' of github.com:block/goose:
  Use session IDs as task IDs for subagents instead of UUIDs (#5398)
  Fix the naming (#5628)
  fix: default tetrate model is broken, replace with haiku-4.5 (#5535) (#5587)
  Fetch less and use the right SHA (#5621)
  feat(ui): add custom macOS dock menu with New Window option (#5099)
  feat: remove hints from recipe prompts (#5622)
  docs: October 2025 Community All-Stars spotlight, Hacktoberfest edition (#5625)
  differentiate debug/release in cache key (#5613)
  Unify subrecipe and subagent execution through shared recipe pipeline (#5082)
tlongwell-block added a commit that referenced this pull request Nov 7, 2025
* origin/main: (34 commits)
  Remove some logging (#5631)
  Use session IDs as task IDs for subagents instead of UUIDs (#5398)
  Fix the naming (#5628)
  fix: default tetrate model is broken, replace with haiku-4.5 (#5535) (#5587)
  Fetch less and use the right SHA (#5621)
  feat(ui): add custom macOS dock menu with New Window option (#5099)
  feat: remove hints from recipe prompts (#5622)
  docs: October 2025 Community All-Stars spotlight, Hacktoberfest edition (#5625)
  differentiate debug/release in cache key (#5613)
  Unify subrecipe and subagent execution through shared recipe pipeline (#5082)
  Standardize CLI argument flags and update documentation (#5516)
  Release 1.13.0
  fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575)
  fix: add standard context menu items to prevent empty right-click menu (#5616)
  Bump openapi in prepare-release (#5611)
  docs: add access control section to Developer tutorial (#5615)
  Token state not showing on load, or after message is finished. (#5606)
  Change the other location too (#5608)
  feat(ui): bring back quick launcher (#5144)
  Support platform tools through CLI (#5570)
  ...
michaelneale added a commit that referenced this pull request Nov 10, 2025
* main: (33 commits)
  Fix Claude Code provider to default to Auto mode (#5638) (#5642)
  Scheduler cleanup (#5571)
  Better search paths and handling of CLI providers (#5554)
  docs: description required for "Add Extension" in cli - phase 2 (#5635)
  Remove some logging (#5631)
  Use session IDs as task IDs for subagents instead of UUIDs (#5398)
  Fix the naming (#5628)
  fix: default tetrate model is broken, replace with haiku-4.5 (#5535) (#5587)
  Fetch less and use the right SHA (#5621)
  feat(ui): add custom macOS dock menu with New Window option (#5099)
  feat: remove hints from recipe prompts (#5622)
  docs: October 2025 Community All-Stars spotlight, Hacktoberfest edition (#5625)
  differentiate debug/release in cache key (#5613)
  Unify subrecipe and subagent execution through shared recipe pipeline (#5082)
  Standardize CLI argument flags and update documentation (#5516)
  Release 1.13.0
  fix: move goosehints/AGENTS.md handling to goose, and out of developer extension (#5575)
  fix: add standard context menu items to prevent empty right-click menu (#5616)
  Bump openapi in prepare-release (#5611)
  docs: add access control section to Developer tutorial (#5615)
  ...
tiensi added a commit to tiensi/goose that referenced this pull request Nov 11, 2025
* main: (83 commits)
  silence copilot on minor text issues (block#5665)
  fix: disallow runaway subagent chains (block#5659)
  chore: remove usage of non-existent env var for log dir (block#5658)
  clarify agent instructions (block#5655)
  feat: add check-everything for unified style checks (block#5650)
  Show errors on failure (block#5643)
  custom instructions for copilot reviews (block#5646)
  fix: prevent repeated 404 errors when accessing deleted sessions (block#5644)
  Flake.nix corrected main (block#5600)
  fix: goose recipe list can return duplicated entries (block#5645)
  fix: bedrock creds refresh (block#5599)
  Fix Claude Code provider to default to Auto mode (block#5638) (block#5642)
  Scheduler cleanup (block#5571)
  Better search paths and handling of CLI providers (block#5554)
  docs: description required for "Add Extension" in cli - phase 2 (block#5635)
  Remove some logging (block#5631)
  Use session IDs as task IDs for subagents instead of UUIDs (block#5398)
  Fix the naming (block#5628)
  fix: default tetrate model is broken, replace with haiku-4.5 (block#5535) (block#5587)
  Fetch less and use the right SHA (block#5621)
  ...
Surendhar-N-D pushed a commit to Surendhar-N-D/goose that referenced this pull request Nov 17, 2025
Co-authored-by: Douwe Osinga <[email protected]>
arul-cc pushed a commit to arul-cc/goose that referenced this pull request Nov 17, 2025
Co-authored-by: Douwe Osinga <[email protected]>
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
Co-authored-by: Douwe Osinga <[email protected]>
Signed-off-by: Blair Allan <[email protected]>
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.

4 participants