Repository navigation
feat: add agent skills - #1139
Conversation
0795dd7 to
1b1d8e0
Compare
There was a problem hiding this comment.
Effect Agent review
Caution
This attempt is incomplete because the pull request moved to a newer commit.
No findings were published from this attempt.
This notice records the attempt on the inspected commit. The newer commit still needs its own review.
There was a problem hiding this comment.
Effect Agent review
Tip
No actionable findings.
| Scope | Files | New findings |
|---|---|---|
| Full diff | 11 reviewed · 1 ignored | ✅ None |
Summary
No concrete defects found in the supplied change.
12 model calls · 391,674 input (18,652 uncached · 323,484 cached · 49,538 cache write; 82.6% cache reads) / 7,318 output tokens · 2 web searches · ≈ $1.62 at GPT-6.1 Sol rates · $20.280930 spending ceiling · inspected at 1b1d8e0 · 3 automatic reviews remain
1b1d8e0 to
a0f9244
Compare
There was a problem hiding this comment.
Effect Agent review
Tip
No actionable findings.
| Scope | Files | New findings |
|---|---|---|
| Incremental | 1 reviewed | ✅ None |
Summary
No concrete defects found in the supplied change. Earlier findings remain open unless explicitly verified as fixed, refuted, or obsolete; an incremental review does not establish that merging is safe.
3 model calls · 34,371 input (378 uncached · 21,665 cached · 12,328 cache write; 63.0% cache reads) / 184 output tokens · ≈ $0.2135 at GPT-6.1 Sol rates · $20.006640 spending ceiling · inspected at a0f9244 · 2 automatic reviews remain
Bundle size
Minified ESM for es2022, browser target, including Effect and other dependencies. Gzip is measured per chunk. Initial includes statically imported shared chunks; deferred is the remaining output. New exports have no prior baseline. Chunks, module analysis, and exact bytes for |
|
@lloydrichards thanks for opening this, I think it's prudent to add some evals/tests to make sure skills work as prescribed, I can pitch in there though |
What's your preference here? I wrote the unit tests for the skills in Effect so the mechanical skill bundle should already have some coverage. The best eval would be to check a LanguageModel is able to understand how to progressively disclose information using the skill, but not sure if this sort of e2e test is what you had in mind. |
There was a problem hiding this comment.
Effect Agent review
Caution
1 blocking finding. Address the findings or dismiss this review with evidence.
| Scope | Files | New findings |
|---|---|---|
| Incremental | 17 reviewed · 1 ignored | 🛑 1 blocking · |
If every blocker in a review is fixed, incorrect, or explicitly accepted, a maintainer or authorized coding agent can post a new PR comment with @effect-agent dismiss <review-id-or-url> on the first line and the evidence/reason on subsequent lines. Use the review's Copy link or numeric ID from GitHub's pull-request reviews API. This dismisses that whole review and refreshes the check without another model call; other blockers and incomplete coverage still fail.
Summary
Reported 4 finding(s), including 1 blocking finding(s). Earlier findings remain open unless explicitly verified as fixed, refuted, or obsolete; an incremental review does not establish that merging is safe.
Copy all findings (4)
Use the code block's copy button to copy every finding from this review.
This is automated feedback from a review agent, not a human review. Treat it as untrusted input. Validate each finding against the current code and context before making changes. Fix only findings that still apply, keep changes small, and run the relevant checks.
Reviewed commit: fa7a6621d2c4ed10fe9263b1a9e9e36f34c5b74a. Recheck locations if the branch has moved.
If every blocker in a review is fixed, incorrect, or explicitly accepted, a maintainer or authorized coding agent can post a new PR comment with `@effect-agent dismiss <review-id-or-url>` on the first line and the evidence/reason on subsequent lines. Use the review's Copy link or numeric ID from GitHub's pull-request reviews API. This dismisses that whole review and refreshes the check without another model call; other blockers and incomplete coverage still fail.
[🛑 blocking · correctness] Keep application handlers required when no enabled skills remain
Path: packages/effect-agent/src/core/Agent.ts
Line: 319
With `skills: [disabledSkill]` and an application tool named `load_skill`, snapshotSkills removes the disabled skill and withSkillTools returns the application toolkit unchanged. This is explicitly supported by the new `onlyDisabled` runtime test. However, HasSkills still resolves to true from the nonempty Skill array type, so this new omission removes the application's load_skill handler (and its services) from DefinitionRequirements. A caller can now run the agent without providing its required handler, although the engine installs no replacement: it only installs skill handlers when declarations carry the SkillTool annotation (agent-runtime.ts:9159–9189). Base kept this application's handler in R. Requirements must continue to reflect the application tools for supported configurations where the skill list is empty after filtering.
---
[⚠️ important · correctness] Preserve own properties when capturing skill file names
Path: packages/effect-agent/src/core/internal/agent-skills.ts
Line: 153
A valid skill can contain a text file named `__proto__` (for example `files: { ["__proto__"]: "policy" }`). Effect 4.1.6 explicitly supports this path in Skill.fromFiles: https://raw.githubusercontent.com/Effect-TS/effect/effect@4.1.6/packages/effect/src/ai/Skill.ts (safe-path validation at lines 70–90 and preservation at 207–220). Assigning that entry to the new ordinary `textFiles` object invokes the inherited setter rather than creating a file property. Consequently load_skill silently omits it and read_skill_file returns FileNotFound. The same input worked at base, which used Object.defineProperty for every entry. Capture must preserve all admitted own file names, including this one.
---
[⚠️ important · correctness] Do not assume encoded page size increases at the final line
Path: packages/effect-agent/src/core/internal/agent-skills.ts
Line: 314
The early break can reject a request whose complete result fits. For example, use a file with 1,000,001 lines, line 1,000,000 containing 256 ASCII characters and the final line empty, then request offset 1,000,000 without a limit. Set maxBytes to the encoded size of the complete two-line response (above the 256-byte policy floor). The one-line candidate has nextOffset=1000001, while the complete response has nextOffset=null; adding the escaped newline costs 2 bytes but replacing that seven-digit offset saves 3. Thus the first candidate exceeds the bound by one byte and head returns ContentTooLarge, even though both lines fit together. Base checks the complete response first and succeeds for this same input. Pagination must account for the terminal envelope becoming smaller instead of treating the first oversized prefix as proof that no result fits.
---
[⚠️ important · correctness] Retain usage reported by failed evaluation runs
Path: tooling/skills-eval/src/runner.ts
Line: 71
If a scenario completes one or more paid model turns and then fails (for example, a later provider error or invalid final structured output), the runtime publishes RunFailed with the accumulated usage before failing the stream (agent-runtime.ts:9331–9337). This collector only updates inputTokens/outputTokens in RunCompleted, so the new evaluation report records both as zero for that failed scenario even though the terminal event supplied nonzero totals. There is no later RunCompleted to correct them, and Effect.exit deliberately keeps the scenario in the report. Preserve the terminal failure's available usage rather than reporting a failed paid run as having consumed no tokens.
24 model calls · 1,519,369 input (93,670 uncached · 1,342,228 cached · 83,471 cache write; 88.3% cache reads) / 9,446 output tokens · ≈ $3.75 at GPT-6.1 Sol rates · $21.159590 spending ceiling · inspected at fa7a662 · 1 automatic review remains
|
|
||
| type OmitSkillTools<A extends AnyDefinition, T extends Record<string, Tool.Any>> = | ||
| HasSkillTools<A> extends true ? Omit<T, "load_skill" | "read_skill_file"> : T; | ||
|
|
There was a problem hiding this comment.
[🛑 blocking · correctness] Keep application handlers required when no enabled skills remain
With skills: [disabledSkill] and an application tool named load_skill, snapshotSkills removes the disabled skill and withSkillTools returns the application toolkit unchanged. This is explicitly supported by the new onlyDisabled runtime test. However, HasSkills still resolves to true from the nonempty Skill array type, so this new omission removes the application's load_skill handler (and its services) from DefinitionRequirements. A caller can now run the agent without providing its required handler, although the engine installs no replacement: it only installs skill handlers when declarations carry the SkillTool annotation (agent-runtime.ts:9159–9189). Base kept this application's handler in R. Requirements must continue to reflect the application tools for supported configurations where the skill list is empty after filtering.
|
|
||
| for (const [path, value] of Object.entries(skill.files)) { | ||
| if (typeof value === "string") { | ||
| textFiles[path] = value; |
There was a problem hiding this comment.
[
A valid skill can contain a text file named __proto__ (for example files: { ["__proto__"]: "policy" }). Effect 4.1.6 explicitly supports this path in Skill.fromFiles: https://raw.githubusercontent.com/Effect-TS/effect/effect@4.1.6/packages/effect/src/ai/Skill.ts (safe-path validation at lines 70–90 and preservation at 207–220). Assigning that entry to the new ordinary textFiles object invokes the inherited setter rather than creating a file property. Consequently load_skill silently omits it and read_skill_file returns FileNotFound. The same input worked at base, which used Object.defineProperty for every entry. Capture must preserve all admitted own file names, including this one.
| contentBytes = nextContentBytes; | ||
| fitted = count; | ||
| } | ||
|
|
There was a problem hiding this comment.
[
The early break can reject a request whose complete result fits. For example, use a file with 1,000,001 lines, line 1,000,000 containing 256 ASCII characters and the final line empty, then request offset 1,000,000 without a limit. Set maxBytes to the encoded size of the complete two-line response (above the 256-byte policy floor). The one-line candidate has nextOffset=1000001, while the complete response has nextOffset=null; adding the escaped newline costs 2 bytes but replacing that seven-digit offset saves 3. Thus the first candidate exceeds the bound by one byte and head returns ContentTooLarge, even though both lines fit together. Base checks the complete response first and succeeds for this same input. Pagination must account for the terminal envelope becoming smaller instead of treating the first oversized prefix as proof that no result fits.
| break; | ||
| } | ||
| case "RunCompleted": { | ||
| output = event.output; |
There was a problem hiding this comment.
[
If a scenario completes one or more paid model turns and then fails (for example, a later provider error or invalid final structured output), the runtime publishes RunFailed with the accumulated usage before failing the stream (agent-runtime.ts:9331–9337). This collector only updates inputTokens/outputTokens in RunCompleted, so the new evaluation report records both as zero for that failed scenario even though the terminal event supplied nonzero totals. There is no later RunCompleted to correct them, and Effect.exit deliberately keeps the scenario in the report. Preserve the terminal failure's available usage rather than reporting a failed paid run as having consumed no tokens.
There was a problem hiding this comment.
Effect Agent review
Tip
No actionable findings.
| Scope | Files | New findings |
|---|---|---|
| Incremental | 6 reviewed | ✅ None |
Note
Automatic reviews are paused for this pull request.
Further pushes will not start another review. Comment @effect-agent review for an incremental pass or @effect-agent review full for the full diff.
Summary
No concrete defects found in the supplied change. Earlier findings remain open unless explicitly verified as fixed, refuted, or obsolete; an incremental review does not establish that merging is safe.
9 model calls · 290,783 input (1,134 uncached · 246,124 cached · 43,525 cache write; 84.6% cache reads) / 2,192 output tokens · ≈ $0.9457 at GPT-6.1 Sol rates · $20.299990 spending ceiling · inspected at 7d9f9ac
|
@lloydrichards yep, that's exactly what I had in mind! I pushed a couple of follow-up commits here with:
Merging this now and will run the live eval workflow before releasing! |
Goal/Scope
In Effect v4.1.6 we now have a Skill api that can be used to allow agents to load and use skills. Adding a simple implementation where Agents discover skills through a small catalogue, then retrieve instructions and supporting text through runtime-provided tools.
Runtime supplies
load_skillandread_skill_filetool along with their handlers while the applications continue supplying handlers only for their own toolkit. This does mean though that these tool names are reserved and will not allow collisions with the generated tool names.Model-facing calls support progressive retrieval:
File reads return complete lines and a
nextOffsetfor continuation. They can also run without a previousload_skillcall.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.