Repository navigation
docs: slim AGENTS.md; compact start for small-window models; fix fm tool schemas - #480
Merged
Merged
Conversation
…rules once A model whose context window is 16K or less (fm, 8K) cannot take the default start: the system prompt alone measured 18,312 tokens and the tool declarations 8,108. Such a session now starts on a compact profile - a short prompt naming the working directory plus the essential tools (read, write, edit, bash, search, find, ls) - in both interactive and print mode. Measured against fm serve, the first turn is about 1,300 tokens. Context-file discovery walking up from a linked worktree under its own primary checkout (.worktrees/<name>) no longer loads the same repository's AGENTS.md a second time from the checkout above it. Signed-off-by: pi <dimetron@me.com>
The fm schema rewrite dropped the 'pattern' keyword, which Apple rejects, but it filtered property names the same way, so find's and ripgrep's required 'pattern' parameter was deleted. The model was never offered it and every find call failed with 'pattern is required'. Property names are now kept; only their schemas are rewritten. Each object now carries x-order (required properties first), which fm serve asks for instead of generating properties alphabetically. The server does not tokenize it - 8,016 prompt tokens with or without it on the 40 captured tools - so the size guard leaves it out of its estimate, which it had overcounted by about 600 tokens. Signed-off-by: pi <dimetron@me.com>
AGENTS.md is injected into every session, so it now holds only the rules that always apply (790 -> 130 lines). The reasons, commands and history behind them move to skills under .pi-go/skills: git-workflow, pr-workflow, windows-ci, tool-compaction and proof-check, with a table naming which to read before which kind of work. Signed-off-by: pi <dimetron@me.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
- Coverage 91.50% 91.49% -0.02%
==========================================
Files 394 395 +1
Lines 50610 50693 +83
==========================================
+ Hits 46313 46382 +69
- Misses 4291 4305 +14
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGENTS.md: 790 lines down to 130. It is injected into every session, so it now holds only the rules that always apply. Procedures, reasons and history move into five skills under
.pi-go/skills/(git-workflow,pr-workflow,windows-ci,tool-compaction,proof-check). A table in AGENTS.md names which skill to read before which kind of work.Compact start for small-window models. A model with a context window of 16K or less now starts with a short system prompt (working directory plus a few rules) and only the core tools: read, write, edit, bash, search, find, ls. This applies in both interactive and print mode. Before this, fm could not take even a first turn: the default system prompt measured 18,312 tokens and the tool declarations 8,108, against an 8,192-token window. Against a real
fm serve, the compact first turn is about 1,300 tokens.Project rules loaded once from worktrees. Running from
<repo>/.worktrees/<name>, context-file discovery used to load the repository's AGENTS.md twice: once from the worktree and once from the primary checkout above it, possibly from a different branch. A checkout of the same repository above the starting one is now skipped.fm schema fix (bug on main since #478). The rewrite removed the
patternkeyword, which Apple rejects, but it filtered parameter names the same way. Sofind's andripgrep's requiredpatternparameter was deleted, and everyfindcall failed with "pattern is required". The existing test checked that the string"pattern"appeared nowhere in the output, so it passed because of the bug; it now checks the keyword form only and asserts the parameter survives. Objects also gainx-order(required properties first), whichfm serveasks for instead of generating properties alphabetically.Size check. The server's count for the 40 captured tools is 8,016 tokens with or without
x-order, so it doesn't tokenize it. pi's estimate counted it as about 600 tokens, sox-orderis left out of the estimate.Testing
make build,make vet,make lint(0 issues) andmake testall pass.TestFMGuardAgreesWithTheServerpasses against a livefm serve.fm/system:pi --mode print --model fm/systemwas given the task of fixing a one-line bug (a - binstead ofa + b) and runninggo test.findgets itspattern.src/,tests/) before listing files. In one run it made the right edit and then overwrote the file withread's output, line numbers included. The changes here make fm usable at all; they don't make the on-device model a good coding agent. Treat it as asmol-role model for short tasks without tools.fm/pccwas not tested. Apple only serves it whenfm serveis launched from Terminal.app.