Skip to content

fix(export): match harness allowedTools for customer tools and keep model parameters - #2456

Open
amhegazy-mp4 wants to merge 1 commit into
aws:refactorfrom
amhegazy-mp4:fix/export-harness-fidelity
Open

amhegazy-mp4 wants to merge 1 commit into
aws:refactorfrom
amhegazy-mp4:fix/export-harness-fidelity

Conversation

@amhegazy-mp4

Copy link
Copy Markdown

Description

agentcore export harness now matches the harness it exports in two places:

  • allowedTools for configured tools. A bare pattern (shell, file_*) selects built-in tools only, and @name selects a configured tool (MCP server, inline function, gateway, browser, code interpreter), as the harness does. Previously @name dropped the tool and a bare name kept it. A bare built-in name such as shell now also selects the built-in, which previously required @builtin/shell. matchesAllowedTools now takes the server and tool separately instead of a flattened name.
  • Model additionalParams. For bedrock, open_ai, and gemini, export harness --arn carries the harness model's additionalParams into the generated model/load.py (Bedrock additional_args; params for Mantle, OpenAI, and Gemini) instead of dropping them with an export note. Explicit model settings (temperature, max tokens, ...) take precedence. The local harness spec still omits the field, since harness.yaml accepts it only for lite_llm, so the values are passed to the export alongside the spec.

Behavior changes for new exports: a bare configured-tool name in allowedTools no longer keeps that tool (use @name), matching the harness.

Related Issue

Closes #2455

Documentation PR

Not applicable.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

  • I ran bun test
  • I ran the relevant end-to-end tests with bun run test:e2e, or explained why they are not applicable: there are no export end-to-end tests. Instead I rendered an export and ran it against Bedrock: allowedTools: ["@mcp"] kept the MCP server and the model called its tool, and Bedrock accepted the carried-over additionalParams.
  • I ran bun run typecheck
  • I ran bun run lint:check
  • I ran bun run format:check
  • I ran bun run build
  • If I modified src/assets/, I updated affected snapshots with bun test <test-file> --update-snapshots and committed them (no snapshots changed)

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.

@github-actions github-actions Bot added the size/m PR size: M label Sep 29, 2026
@amhegazy-mp4
amhegazy-mp4 force-pushed the fix/export-harness-fidelity branch from 247d056 to 86eca92 Compare September 29, 2026 19:57
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 29, 2026
@amhegazy-mp4 amhegazy-mp4 changed the title fix(export): match harness allowedTools for configured tools and keep model additionalParams fix(export): match harness allowedTools for customer tools and keep model parameters Sep 29, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 29, 2026
@amhegazy-mp4
amhegazy-mp4 force-pushed the fix/export-harness-fidelity branch from 86eca92 to 667fe6c Compare September 29, 2026 20:25
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Sep 29, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.23%. Comparing base (924ab68) to head (667fe6c).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #2456   +/-   ##
=========================================
  Coverage     97.23%   97.23%           
=========================================
  Files           606      606           
  Lines         42479    42475    -4     
=========================================
- Hits          41304    41301    -3     
+ Misses         1175     1174    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…odel parameters

- allowedTools: a bare pattern selects builtins only, and @server selects
  a customer tool (MCP server, inline function, gateway, browser, code
  interpreter), as the harness runtime does. Previously @server dropped
  the tool and a bare name kept it; a bare builtin name ("shell") now
  also selects the builtin, as intended.
- Service model additionalParams for bedrock, open_ai, and gemini are
  carried into the generated model loader instead of being dropped with
  a note. The local harness spec still omits them, since its deploy
  schema accepts them only for lite_llm.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants