Commit Graph

3583 Commits

Author SHA1 Message Date
Tyler Longwell 4f06bd1c22 Merge remote-tracking branch 'origin/summon_extension' into tui_gem_delegate
* origin/summon_extension:
  fix(summon): prioritize locality over type in source discovery
2026-02-06 16:04:39 -05:00
Tyler Longwell dc9b0aa3a5 fix(summon): prioritize locality over type in source discovery 2026-02-06 16:04:09 -05:00
Tyler Longwell 96173be4d1 Merge remote-tracking branch 'origin/summon_extension' into tui_gem_delegate
* origin/summon_extension:
  feat(summon): improve delegate tool description with effective delegation guidance
  Auto-inject summon extension for recipes with sub_recipes
2026-02-06 09:55:17 -05:00
Tyler Longwell ed43363d85 feat(summon): improve delegate tool description with effective delegation guidance
Replace redundant Options section (duplicated parameter descriptions) with
practical guidance on using delegates effectively:

- Clarify that delegates know only instructions + source content
- Warn that delegates cannot coordinate and same-file work causes conflicts
- Explain async/sync usage: parallel needs async + sleep, single task uses sync
- Distinguish research (read-only, parallelize freely) from work (partition files)
- Add orchestration pattern: decompose → async delegates → sleep → synthesize
- Update combined mode with concrete example: source + instructions pairing
2026-02-06 08:19:26 -05:00
Tyler Longwell d14236aa84 fix: correctly deserialize ResumeAgentResponse in goose-client 2026-02-06 07:52:42 -05:00
Tyler Longwell f1483efa82 Auto-inject summon extension for recipes with sub_recipes
When a recipe defines sub_recipes, the summon extension is now automatically
added to the extensions list. This ensures the delegate tool is available
without requiring users to manually specify the summon extension.

Changes:
- Add ensure_summon_for_subrecipes() helper in Recipe that auto-injects
  the summon platform extension when sub_recipes are present
- Update test assertions to expect summon in extension list
- Update test script to look for 'delegate' instead of 'subagent'
2026-02-06 07:22:03 -05:00
Tyler Longwell b2fffdf32a Merge remote-tracking branch 'origin/summon_extension' into tui_gem_delegate
* origin/summon_extension:
  Auto-inject summon extension for recipes with sub_recipes
  fix: enable subrecipes discovery in CLI and show parameters in descriptions
2026-02-05 15:02:22 -05:00
Tyler Longwell b01e58b160 Auto-inject summon extension for recipes with sub_recipes
When a recipe defines sub_recipes, the summon extension is now automatically
added to the extensions list. This ensures the delegate tool is available
without requiring users to manually specify the summon extension.

Changes:
- Add ensure_summon_for_subrecipes() helper in Recipe that auto-injects
  the summon platform extension when sub_recipes are present
- Update test assertions to expect summon in extension list
- Update test script to look for 'delegate' instead of 'subagent'
2026-02-05 15:01:32 -05:00
Tyler Longwell 1062d047d2 fix: enable subrecipes discovery in CLI and show parameters in descriptions
Two fixes for subrecipes support:

1. CLI now stores recipe on session after creation, allowing the summon
   extension to discover sub_recipes defined in the parent recipe. This
   matches the behavior of goose-server and scheduler.

2. Subrecipe descriptions now show available parameters by loading the
   actual recipe file and extracting parameter keys. Example output:
   'Gather file statistics (params: directory, fast_mode)'
2026-02-05 14:04:21 -05:00
Tyler Longwell 601c4bf986 Merge remote-tracking branch 'origin/summon_extension' into tui_gem_delegate
* origin/summon_extension:
  fix: support unprefixed tools in code_execution extension
  tool description to include subrecipes
2026-02-05 13:23:16 -05:00
Tyler Longwell 2a640bb430 fix: support unprefixed tools in code_execution extension
The load_callback_configs function was failing when encountering
unprefixed tools (like summon's load/delegate) because it expected
all tool names to contain '__'. Now uses get_tool_owner() to get
the namespace for unprefixed tools, making them available in code
execution mode as Summon.load() and Summon.delegate().
2026-02-05 13:16:10 -05:00
Tyler Longwell e2dcc02efd tool description to include subrecipes 2026-02-05 12:47:52 -05:00
Tyler Longwell 5b5f1b4cbc Merge remote-tracking branch 'origin/summon_extension' into tui_gem_delegate
* origin/summon_extension:
  fix: add write mutex to SessionStorage to prevent SQLite lock contention
2026-02-05 12:16:00 -05:00
Tyler Longwell 382f2ecfb5 fix: add write mutex to SessionStorage to prevent SQLite lock contention
Parallel async delegates were causing 'database is locked' errors due to
concurrent write operations (create_session, add_message) competing for
SQLite's single writer lock.

Solution: Add a tokio::sync::Mutex to SessionStorage that serializes all
write operations. This gracefully handles intra-process contention while
SQLite's busy_timeout (5s) handles any cross-process scenarios.

Protected methods:
- create_session
- add_message
- apply_update
- replace_conversation
- delete_session
- truncate_conversation
- update_message_metadata
2026-02-05 12:14:37 -05:00
Tyler Longwell d41f36418e Merge remote-tracking branch 'origin/summon_extension' into tui_gem_delegate
* origin/summon_extension:
  fix(summon): address PR review feedback
  revert to 25 default subagent turns
  feat(summon): add cancellation support for async delegates
  chore: restore McpApps files formatting from origin/main
  refactor: use session ID as async task identifier
  refactor: remove model shorthand translation from summon extension
  docs: clarify delegate parallel execution requires async flag
  refactor: remove self-obvious comments from extension_manager and summon_extension
  refactor: remove self-obvious comments and consolidate source discovery
  feat(summon): persist async delegate results for retrieval via load()
  Update goose-self-test.yaml for new load/delegate tools
  fix: resolve tool prefix lookup and code duplication issues
  refactor(summon): restore builtin skills as bundled files
  chore: remove non-doc comments from summon extension
  feat: add unprefixed tools support for platform extensions
  fix(summon): add meaningful prompts for skill/agent delegation
  feat: Add summon extension replacing subagent tool and skills extension
2026-02-05 09:48:10 -05:00
Tyler Longwell fccc8fa918 Merge origin/main into tui_gem
Resolves unicode-width dependency conflict between pctx (needs ^0.2.1 via
deno/swc) and ratatui 0.29 (pins =0.2.0) by:

- Using tui-textarea from PR #122 (ratatui 0.30 support) pinned to commit
  48792febd9d454fefdd869de0e75849cad6e6007
  https://github.com/rhysd/tui-textarea/pull/122
- Upgrading goose-tui to ratatui 0.30, crossterm 0.29, ansi-to-tui 8.0.1
- Fixing type ambiguity in chat.rs/info.rs (multiple unicode-width versions)
- Updating tests for CallToolRequestParams API change (added meta field)
2026-02-05 09:44:10 -05:00
Tyler Longwell 418a2fa97b Merge remote-tracking branch 'origin/main' into summon_extension
* origin/main:
  fix: detect context length errors in GCP Vertex AI provider (#6976)
  Added the ability to escape Jinja variables in recipes to include them in prompts (#6975)
  Bug Fix: bump pctx (#6967)
  fix(acp): fixtures now raise content mismatch errors (#6912)
  custom provider form minor improvements (#6966)
  Fix 'Edit In Place' feature appending instead of editing messages (#6955)
  docs: change RPI slash commands (#6963)
2026-02-05 08:56:45 -05:00
Tyler Longwell 2bbfed0198 fix(summon): address PR review feedback
- Add Drop impl to cancel background tasks on shutdown (best-effort via try_lock)
- Propagate ModelConfig::new error instead of unwrap
- Document unprefixed_tools field in PlatformExtensionDef
2026-02-05 08:01:21 -05:00
Tyler Longwell 88f8ef48d8 revert to 25 default subagent turns 2026-02-05 07:51:03 -05:00
Rabi Mishra d1b6053d2f fix: detect context length errors in GCP Vertex AI provider (#6976)
Signed-off-by: rabi <ramishra@redhat.com>
2026-02-05 12:49:22 +00:00
Peter Willemsen e701350f5d Added the ability to escape Jinja variables in recipes to include them in prompts (#6975)
Signed-off-by: Peter Willemsen <peter@codebuffet.co>
2026-02-05 12:37:57 +00:00
Elias Posen 2992856231 Bug Fix: bump pctx (#6967)
Signed-off-by: Elias Posen <elias@posen.ch>
2026-02-05 12:07:47 +00:00
Adrian Cole aa4f320d23 fix(acp): fixtures now raise content mismatch errors (#6912)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
2026-02-05 06:32:16 +00:00
Tyler Longwell 9b928350a5 feat(summon): add cancellation support for async delegates
Add ability to cancel running background tasks via load(source: "task_id", cancel: true).

- Store CancellationToken in BackgroundTask instead of creating orphan tokens
- Add `cancel` parameter to load tool schema
- Cancel triggers token, waits up to 5s for graceful shutdown, then aborts
- Cancelled tasks return partial output with "⊘ Cancelled" status
- Update MOIM hint to show cancel option when tasks are running
- Add cancellation test to goose-self-test.yaml
2026-02-04 22:38:33 -05:00
Zane 5fc21ce094 custom provider form minor improvements (#6966) 2026-02-05 00:03:44 +00:00
Bright Zheng 950f1412ab Fix 'Edit In Place' feature appending instead of editing messages (#6955)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Zane Staggs <zane@squareup.com>
2026-02-04 22:03:24 +00:00
Angie Jones 78a9e48836 docs: change RPI slash commands (#6963)
Co-authored-by: dianed-square <73617011+dianed-square@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-04 21:48:51 +00:00
Tyler Longwell bbfa545297 chore: restore McpApps files formatting from origin/main 2026-02-04 16:44:47 -05:00
Tyler Longwell 0e8f656706 Merge origin/main into summon_extension
Resolved conflicts:
- Updated McpClientTrait::call_tool signature to include working_dir parameter
- Re-exported SUBAGENT_TOOL_REQUEST_TYPE from agents module for goose-cli
- Integrated origin/main's working_dir support with summon_extension's changes
2026-02-04 16:41:02 -05:00
Tyler Longwell 0a934c335a refactor: use session ID as async task identifier
Replace custom task_id generation with session ID (YYYYMMDD_N format).
This simplifies the code and makes task IDs match session IDs for
easier debugging and correlation.
2026-02-04 16:13:21 -05:00
Tyler Longwell 05b8639fe7 refactor: remove model shorthand translation from summon extension
Model names should be specified in full by the agent/recipe.
The provider layer handles validation. Removes unnecessary
maintenance burden of keeping shorthand mappings up to date.
2026-02-04 15:56:56 -05:00
Tyler Longwell 314a687140 docs: clarify delegate parallel execution requires async flag
- Update delegate tool description: 'Parallel execution requires async: true'
- Expand goose-self-test.yaml parallel delegate test to explicitly validate:
  - Sync delegates run sequentially even when called in same message
  - Async delegates run in parallel when called in same message
  - Test includes timestamp comparison to verify behavior

This documents the expected behavior due to MCP protocol constraints where
sync tool calls are serialized per extension connection.
2026-02-04 15:34:56 -05:00
Tyler Longwell d526616aa4 refactor: remove self-obvious comments from extension_manager and summon_extension
Removed doc comments that merely restate what the code does:
- extension_manager.rs: get_tool_owner, is_unprefixed_extension
- summon_extension.rs: skill/agent directory comments, handle_load_source,
  get_task_description

These comments added no value beyond what the function names and code
already communicate clearly.
2026-02-04 15:15:28 -05:00
Tyler Longwell 44ee9c1e67 refactor: remove self-obvious comments and consolidate source discovery
Review feedback:
- Remove doc comments that restate what code does (extension.rs,
  extension_manager.rs, subagent_handler.rs, summon_extension.rs)
- Consolidate add_local_*, add_global_*, add_recipe_path_* functions
  into a single discover_filesystem_sources() method that builds
  directory lists declaratively and iterates through them

The source discovery consolidation reduces ~80 LOC by eliminating
8 separate add_* methods and replacing them with inline directory
list construction using iterator chains.
2026-02-04 15:04:47 -05:00
Douwe Osinga 6ae72a6cf0 Use haiku for databricks (#6943)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
2026-02-04 17:17:59 +00:00
jh-block 5492052f0c Allow copying long strings to the clipboard in the diagnostics viewer (#6951) 2026-02-04 18:17:50 +01:00
Andrew Harvard 2b90c2c310 feat(mcp-apps): add Permission Policy support for sandbox iframes (#6947) 2026-02-04 16:52:11 +00:00
Zane d8d9bb741b fix tool confirmations not showing up mid chat (#6935) 2026-02-04 15:37:21 +00:00
Tyler Longwell 33129578c7 feat(summon): persist async delegate results for retrieval via load()
When async delegates complete, their results are now persisted in
completed_tasks instead of being discarded. The agent can retrieve
completed task outputs by calling load(task_id).

Changes:
- Add CompletedTask struct to store task results with metadata
- Add completed_tasks field to SummonClient
- Modify cleanup_completed_tasks() to move finished tasks to completed_tasks
- Add handle_load_task_result() to retrieve and format task output
- Update handle_load() to check for task_ prefix and call cleanup first
- Update get_moim() to show completed tasks with retrieval hints
- Update handle_load_discovery() to list completed tasks awaiting retrieval
- Add comprehensive test_async_task_result_lifecycle test

MOIM now shows:
- Running tasks with sleep hint
- Completed tasks with 'use load("task_id") to get result' hint

Implements TASK-09A from #6202
2026-02-04 10:21:02 -05:00
dianed-square f3d969c317 docs: custom model definitions (#6910) 2026-02-04 15:07:26 +00:00
Tyler Longwell 17d064d794 Update goose-self-test.yaml for new load/delegate tools
- Replace subagent references with delegate tool tests
- Add load tool testing (discovery, builtin skills, knowledge injection)
- Add async delegate test with MOIM monitoring
- Add nested delegation prevention test (critical security)
- Add source-based delegate test
- Rename test_phases parameter value from 'subagents' to 'delegation'
- Clean up trailing whitespace throughout file
2026-02-04 09:54:58 -05:00
Tyler Longwell 994b9022e9 fix: resolve tool prefix lookup and code duplication issues
- Add prefix-based fallback in resolve_tool() to handle prefixed tool
  calls without triggering tools/list, fixing MCP replay test failures
- Set unprefixed_tools: true for code_execution extension to maintain
  backward compatibility with LLMs calling execute_code without prefix
- Refactor subagent_handler with OnMessageCallback type and
  run_subagent_task_with_callback() to eliminate code duplication
- Update summon_extension to use shared subagent infrastructure
- Fix CLI output.rs to recognize unprefixed tool names (execute_code,
  delegate) for proper rendering

All 548 lib tests and 4 MCP integration tests pass.
2026-02-04 09:02:34 -05:00
Songlin Yang 79088dbc80 fix(1785): enable lto and codegen-units in release build (#6586)
Signed-off-by: lsytj0413 <511121939@qq.com>
2026-02-04 13:34:09 +00:00
Tyler Longwell 2a286158ce refactor(summon): restore builtin skills as bundled files
Replace inline string literals with compile-time bundled .md files
using include_dir!, matching the pattern used for system prompts.

- Add builtin_skills module with include_dir! macro
- Restore goose_doc_guide.md skill file from main
- Update summon_extension to use builtin_skills::get_all()

Benefits:
- Easier to maintain with full editor support
- Syntax highlighting for markdown content
- Simple to add new skills (just create .md files)
- Consistent with prompts/ directory pattern
2026-02-04 07:35:41 -05:00
Tyler Longwell db919e75b0 chore: remove non-doc comments from summon extension
Clean up implementation by removing explanatory inline comments.
The code is self-documenting through clear naming and structure.

Removed ~55 comments including:
- Implementation detail explanations
- Precedence order comments
- Test section labels
- Inline explanatory notes

All doc comments (///) preserved for public API documentation.
2026-02-04 07:26:22 -05:00
Tyler Longwell e9b2d62540 feat: add unprefixed tools support for platform extensions
Implement meta-based tool ownership to enable platform extensions to
expose tools without the extension__ prefix.

Changes:
- Add unprefixed_tools flag to PlatformExtensionDef (enabled for summon)
- Embed goose_extension in Tool.meta for all tools during fetch
- Add resolve_tool() helper using meta-based ownership lookup
- Simplify dispatch_tool_call() to use unified resolution path
- Update filter_tools() and reply_parts.rs to use meta ownership
- Add collision detection for duplicate tool names
- Remove unused get_client_for_tool() method

This allows the summon extension's load and delegate tools to appear
without prefix while maintaining correct dispatch and filtering.
2026-02-04 07:16:37 -05:00
Tyler Longwell c071170f0c fix(summon): add meaningful prompts for skill/agent delegation
- Skill-only delegation now sets prompt: 'Apply the skill knowledge to produce a useful result.'
- Agent-only delegation now sets prompt: 'Proceed with your expertise to produce a useful result.'
- This prevents subagents from receiving the meaningless 'Begin.' prompt

Also includes:
- Agent model override now correctly applied from recipe.settings
- Model/provider/temperature precedence: params > recipe.settings > session
- DEFAULT_SUBAGENT_MAX_TURNS updated to 50 for consistency

Crossfire review scores:
- Default subagent: 8.5/10
- goose-gpt-5-2: 8/10

No blocking issues found. Ready to merge.
2026-02-03 23:00:27 -05:00
dianed-square 98ba4a9cb1 docs: ovhcloud provider (#6932) 2026-02-03 23:55:34 +00:00
Tyler Longwell 4b69401517 feat: Add summon extension replacing subagent tool and skills extension
Implements unified 'summon' platform extension with two intuitive tools:
- load: Inject knowledge into current context ("teach me this")
- delegate: Run tasks in isolated subagents ("do this for me")

Key features:
- Source discovery from recipes, skills, agents with priority ordering
- Skill/agent frontmatter parsing with Claude model shorthand translation
- Sync and async delegation with background task tracking
- MOIM status reporting for background tasks with rounded durations
- Nested delegation prevention (subagents cannot spawn subagents)
- 60s TTL caching for source discovery

Removes:
- subagent_tool.rs (523 LOC)
- skills_extension.rs (865 LOC)
- builtin_skills/ directory

Adds:
- summon_extension.rs (1834 LOC) - consolidated implementation

The summon extension provides a cleaner mental model while maintaining
all existing functionality. Builtin skills are now inlined in the
extension.

Ref: GitHub Discussion #6202
2026-02-03 18:54:19 -05:00
jh-block e0a1381e39 Allow building with CUDA as the candle backend (#6914) 2026-02-03 22:58:02 +00:00