Commit c14a886
authored
Remove skill content max truncation (#4639)
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
```bash
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.1 parent ee0da19 commit c14a886
8 files changed
Lines changed: 12 additions & 41 deletions
File tree
- .changeset
- packages/agents-runtime
- src/skills
- test/skills
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
14 | | - | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
| |||
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
| |||
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | | - | |
39 | 34 | | |
40 | 35 | | |
41 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | 84 | | |
91 | 85 | | |
92 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 52 | | |
60 | 53 | | |
61 | 54 | | |
| |||
67 | 60 | | |
68 | 61 | | |
69 | 62 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 63 | | |
74 | 64 | | |
75 | 65 | | |
| |||
96 | 86 | | |
97 | 87 | | |
98 | 88 | | |
99 | | - | |
| 89 | + | |
100 | 90 | | |
101 | 91 | | |
102 | 92 | | |
103 | | - | |
104 | 93 | | |
105 | 94 | | |
106 | 95 | | |
| |||
136 | 125 | | |
137 | 126 | | |
138 | 127 | | |
139 | | - | |
140 | 128 | | |
141 | 129 | | |
142 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | 35 | | |
38 | 36 | | |
39 | 37 | | |
| |||
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | | - | |
51 | 48 | | |
52 | 49 | | |
53 | 50 | | |
| |||
61 | 58 | | |
62 | 59 | | |
63 | 60 | | |
64 | | - | |
65 | 61 | | |
66 | 62 | | |
67 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
69 | 67 | | |
70 | 68 | | |
71 | 69 | | |
72 | | - | |
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
| |||
81 | 78 | | |
82 | 79 | | |
83 | 80 | | |
84 | | - | |
85 | 81 | | |
86 | 82 | | |
87 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | | - | |
| 114 | + | |
116 | 115 | | |
117 | | - | |
| 116 | + | |
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
| |||
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
132 | 130 | | |
133 | 131 | | |
134 | | - | |
| 132 | + | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
| |||
0 commit comments