Skip to content

Remove skill content max truncation#4639

Open
KyleAMathews wants to merge 2 commits into
mainfrom
horton/fix-use-skill-truncation
Open

Remove skill content max truncation#4639
KyleAMathews wants to merge 2 commits into
mainfrom
horton/fix-use-skill-truncation

Conversation

@KyleAMathews

Copy link
Copy Markdown
Contributor

Remove max from the skills metadata contract and stop truncating skill content in use_skill. Agents now receive complete skill instructions instead of partial directives plus truncation warnings.

Root Cause

use_skill historically sliced skill markdown to meta.max before inserting the skill instructions into context. Long skills therefore loaded as incomplete directives, causing agents to complain about truncation and potentially follow partial workflows.

Approach

  • Remove the skill-level max field from parsed preamble metadata, extracted metadata, and SkillMeta.
  • Remove the use_skill truncation branch and the truncated tool-result details.
  • Update tests and skill metadata mocks to reflect that large skills load in full.
  • Add a changeset for @electric-ax/agents-runtime.

Key Invariants

  • use_skill inserts complete skill instructions into context.
  • Skill loading no longer reports a truncated flag or warning.
  • Oversized skills should be fixed at the skill-authoring level rather than partially loaded by the runtime.

Non-goals

  • This does not change general context assembly/source-budget truncation behavior.
  • This does not add a replacement hard block for large skills.

Trade-offs

The previous max field acted as a hard per-skill safety cap, but it produced incomplete instructions. This PR removes that contract so legitimate skills are not silently corrupted; if a skill is too large, the skill itself should be split or improved.

Verification

cd packages/agents-runtime
pnpm vitest run test/skills/tools.test.ts test/skills/preamble.test.ts

cd ../..
pnpm --filter @electric-ax/agents-runtime typecheck
GITHUB_BASE_REF=main node scripts/check-changeset.mjs

Results:

  • test/skills/tools.test.ts and test/skills/preamble.test.ts: 17 tests passed.
  • @electric-ax/agents-runtime typecheck passed.
  • Changeset validation passed for @electric-ax/agents-runtime.

Files changed

  • .changeset/remove-skill-content-max.md: adds a patch changeset.
  • packages/agents-runtime/src/skills/types.ts: removes SkillMeta.max.
  • packages/agents-runtime/src/skills/extract-meta.ts: stops defaulting/extracting skill max.
  • packages/agents-runtime/src/skills/preamble.ts: stops parsing max from skill frontmatter.
  • packages/agents-runtime/src/skills/tools.ts: removes skill content truncation and truncated details.
  • packages/agents-runtime/test/skills/*.test.ts: updates tests and fixtures for full skill loading.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Electric Agents Desktop Builds

Build artifacts for commit 6ce6c44.

Platform Status Artifact
macOS Apple Silicon Passed DMG
macOS Intel Passed DMG
Windows x64 Passed Installer
Linux x64 Passed AppImage / deb

Workflow run

@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.93%. Comparing base (ee0da19) to head (6ce6c44).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4639      +/-   ##
==========================================
- Coverage   59.46%   57.93%   -1.53%     
==========================================
  Files         385      342      -43     
  Lines       43039    40296    -2743     
  Branches    12383    11761     -622     
==========================================
- Hits        25591    23347    -2244     
+ Misses      17371    16911     -460     
+ Partials       77       38      -39     
Flag Coverage Δ
packages/agents 72.64% <ø> (ø)
packages/agents-mcp ?
packages/agents-mobile 80.67% <ø> (ø)
packages/agents-runtime 83.44% <100.00%> (-0.03%) ⬇️
packages/agents-server 75.47% <ø> (ø)
packages/agents-server-ui 7.51% <ø> (ø)
packages/electric-ax 51.06% <ø> (ø)
packages/experimental ?
packages/react-hooks ?
packages/start ?
packages/typescript-client ?
packages/y-electric ?
typescript 57.93% <100.00%> (-1.53%) ⬇️
unit-tests 57.93% <100.00%> (-1.53%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Electric Agents Mobile Build

Local mobile checks ran for commit 6ce6c44.

The EAS Android preview build was skipped because the mobile-eas-build label is not present.
Add the mobile-eas-build label to this PR to produce an installable preview build.

Workflow run

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.

1 participant