Repository navigation
Add Freebuff as a first-class agent - #14019
digitallamb wants to merge 3 commits into
Conversation
Freebuff (freeomarchy.com) is Manicode's free AI coding agent CLI. It now rides the same rails as the stock agents: - omarchy-default-agent gains a freebuff case with an npm:freebuff mise install spec, and omarchy-agent launches it; prompts seed the TUI through stdin, the documented path, since the CLI takes no positional prompt. - omarchy-agent-usage-freebuff collects the agents panel record: exact prompts, sessions, and active days from the chat stores under ~/.config/manicode, tokens estimated from message text because the free tier meters credits server-side and no per-message token usage is recorded. The panel's own usage-update discovers it by name, so the update script needs no change. - Menu rows under Setup > Defaults > Agent and Install > AI, a row in the manual's agent table, and the panel manifest description and defaults. - Tests cover the collector (chats, days, tokens, sign-in, mid-write files) and the panel record landing in the usage directory. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
|
Thanks for the thorough write-up. A few things I'd fix before review: Blocking: freebuff)
command=(freebuff)
# Freebuff has no prompt argument; keep stdin on the terminal.
[[ -n ${prompt:-} ]] && echo "Freebuff does not accept an initial prompt; starting without it." >&2
;;Install entry changes the default agent. Preinstalling for everyone ( Also, the link in the description goes to |
Keep prompt launches attached to the TTY, install Freebuff only on request, and avoid changing the default during installation. Harden usage reporting and hide unsupported starter prompts in the agents panel. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
|
Thanks, re-checked: Freebuff no longer gets a piped prompt, and the Install row uses |
|
Thanks, this addresses everything I raised: |
|
Thanks for the feedback @jandrusk, merged incoming changes from main, should be g2g! |
| per_day, file_complete = scan_chat_file(path) | ||
| complete = complete and file_complete | ||
| if per_day: | ||
| entries[key] = {"mtime": stat.st_mtime, "size": stat.st_size, "perDay": per_day} |
There was a problem hiding this comment.
Incomplete scans hide usage When a previously counted chat is caught mid-write, this scan omits it. The cache is invalidated, but the usage-update wrapper still replaces the panel’s last good record with the incomplete result. Prompts, sessions, and token estimates can appear to drop until a later successful scan. Keep the last good entry for that chat or avoid publishing an incomplete record.
Freebuff (freebuff) joins the default agent picker, installed through mise as npm:freebuff with a lazy stub and migration like the other agents. It asks no tool permissions, so there is no bypass flag to pass. Freebuff takes no starting prompt either. Instead of refusing a prompted launch, which from the agents panel or a crash report would fail without a word, omarchy-agent opens Freebuff with the prompt on the clipboard and a notification saying so. Any agent that sets prompt_via_clipboard in its case gets the same handoff, and the panel's starter prompts keep working without knowing which agent is the default. The launcher part of #14019. Co-authored-by: Paul Lamb <plamb@cosmicwonders.us> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What
Adds Freebuff — Manicode's free AI coding agent CLI — as a first-class agent, on the same rails as the stock agents. Follows the shape of #13992/#14004 (Grok) file-for-file:
bin/omarchy-default-agent—freebuffcase withagent_package="npm:freebuff"(npm backend, likenpm:playwright), args + usage updated.bin/omarchy-agent— launch case. Freebuff takes no positional prompt, so--promptseeds the TUI through stdin (printf '%s\n' "$prompt" | freebuff), which the TUI consumes like typed input.bin/omarchy-agent-usage-freebuff— new panel collector (auto-discovered byomarchy-agent-usage-update; no update-script change needed).install/user/mise.sh—omarchy-mise-install npm:freebuff freebuff.Collector design notes
Freebuff keeps chats under
~/.config/manicode/projects/<project>/chats/<UTC ts>/chat-messages.json(a JSON array of{variant: "user"|"ai", id, content, blocks}); message ids embed epoch ms (user-1790830285538), which gives exact per-message local dating.The free tier meters credits server-side (
"creditsCharged": "server"in the CLI's own logs) and records no per-message token usage, so the collector is honest about the split:~/.config/manicode/credentials.json→tierLabel: "Free")freebuffbucket (documented in the panel README table)Caching mirrors the stock collectors: per-file (mtime+size) incremental scan cache + flock +
--force/--limits-onlywindows; a chat caught mid-write degrades to counting escaped user variants rather than vanishing from the totals.Testing
test/shell.d/agent-usage-freebuff-test.sh: 11 checks — chats/sessions/days math across dates, today scoping, token estimates, unsigned-in vs signed-in records, mid-write file resilience, and the wrapper writingfreebuff.jsonfor the panel (withOMARCHY_PATH=$ROOTsince the wrapper scans for collectors under it). All pass.default-agent-test.shandagents-panel-test.shpass on the branch.test/cli("vscode generated theme references current theme file") reproduces on unmodifiedquattro— unrelated.Notes for maintainers
~/.local/binupkeep block like Grok needed — thenpm:mise spec handles it end to end.limits: []and the panel renders that fine.~/.config/omarchy/) and has been in daily use on 4.0.4-1; this PR is the port to the in-tree mechanisms.