Skip to content

Add Freebuff as a first-class agent - #14019

Open
digitallamb wants to merge 3 commits into
omacom:quattrofrom
digitallamb:agent-freebuff
Open

digitallamb wants to merge 3 commits into
omacom:quattrofrom
digitallamb:agent-freebuff

Conversation

@digitallamb

@digitallamb digitallamb commented Oct 2, 2026 •

Copy link
Copy Markdown

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 — freebuff case with agent_package="npm:freebuff" (npm backend, like npm:playwright), args + usage updated.
  • bin/omarchy-agent — launch case. Freebuff takes no positional prompt, so --prompt seeds 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 by omarchy-agent-usage-update; no update-script change needed).
  • Menu — row under Setup > Defaults > Agent, plus an Install > AI entry shown only while the CLI is missing.
  • install/user/mise.sh — omarchy-mise-install npm:freebuff freebuff.
  • Panel manifest + README + manual — description, defaults, agent table.

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:

  • exact: prompts (user messages), sessions (chat dirs), active days, sign-in state (~/.config/manicode/credentials.json → tierLabel: "Free")
  • estimated: tokens from message text at ~4 chars/token, in a single freebuff bucket (documented in the panel README table)

Caching mirrors the stock collectors: per-file (mtime+size) incremental scan cache + flock + --force/--limits-only windows; a chat caught mid-write degrades to counting escaped user variants rather than vanishing from the totals.

Testing

  • New 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 writing freebuff.json for the panel (with OMARCHY_PATH=$ROOT since the wrapper scans for collectors under it). All pass.
  • default-agent-test.sh and agents-panel-test.sh pass on the branch.
  • One pre-existing failure in test/cli ("vscode generated theme references current theme file") reproduces on unmodified quattro — unrelated.

Notes for maintainers

  • Freebuff ships a native (bun-compiled) binary via its npm launcher; the launcher owns updates, so no ~/.local/bin upkeep block like Grok needed — the npm: mise spec handles it end to end.
  • No accounts/limits RPC yet (free tier has none exposed); the record carries limits: [] and the panel renders that fine.
  • If it's useful to see this running before merging: everything here was first built as a user-level overlay (~/.config/omarchy/) and has been in daily use on 4.0.4-1; this PR is the port to the in-tree mechanisms.

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>
@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds Freebuff as an optional coding agent.

The PR appears safe to merge, with a non-blocking risk of temporarily understated Freebuff usage during an incomplete scan.

Findings

  1. P2 Incomplete scans hide usage ▶

Summary

Adds Freebuff as an optional coding agent with menu installation, default-agent launching, and usage collection. The follow-up changes make installation independent of default selection, decline unsupported prompt-seeded launches, and tighten collector authentication and cache handling.

Reviews (2) · Last reviewed commit: "Merge branch 'quattro' into agent-freebu..." · Reviewed by Greptile

Comment thread bin/omarchy-agent Resolved
Comment thread default/omarchy/omarchy-menu.jsonc Resolved
Comment thread install/user/mise.sh Resolved
Comment thread bin/omarchy-agent-usage-freebuff Resolved
Comment thread bin/omarchy-agent-usage-freebuff Resolved
@jandrusk

jandrusk commented Oct 6, 2026

Copy link
Copy Markdown

Thanks for the thorough write-up. A few things I'd fix before review:

Blocking: --prompt hands Freebuff a pipe for stdin. printf '%s\n' "$prompt" | freebuff makes stdin a pipe that hits EOF right after the prompt. A TUI needs a TTY on stdin for raw-mode input, so the session either refuses to start or can't take any keystrokes after the seeded prompt. If Freebuff has no prompt flag, the safest option is to not support --prompt for it rather than steal the TTY:

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. install.ai.freebuff runs omarchy-default-agent --install freebuff, which also switches the user's default agent. An Install row shouldn't do that silently.

Preinstalling for everyone (install/user/mise.sh) is a maintainer call. It adds a third-party npm package to every new install.

Also, the link in the description goes to https://freeomarchy.com, which serves an empty page. The npm package's homepage is https://freebuff.com.

@digitallamb
digitallamb marked this pull request as draft October 6, 2026 16:33
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>
@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks, re-checked: Freebuff no longer gets a piped prompt, and the Install row uses --install-only, so it doesn't change the default agent anymore. Both fixes look good. The branch has merge conflicts with quattro now, though. Could you rebase? Preinstalling it for everyone is still a maintainer call.

@jandrusk

jandrusk commented Oct 7, 2026

Copy link
Copy Markdown

Thanks, this addresses everything I raised: --prompt now refuses instead of piping stdin, the Install row uses --install-only and leaves the default agent alone, and nothing is preinstalled from install/user/mise.sh anymore. The description link is fixed too. LGTM from my side. It currently conflicts with quattro, so it'll need a rebase before a maintainer can merge it.

@digitallamb

Copy link
Copy Markdown
Author

Thanks for the feedback @jandrusk, merged incoming changes from main, should be g2g!

@digitallamb
digitallamb marked this pull request as ready for review October 7, 2026 17:12
Comment on lines +246 to +249
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}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

dhh added a commit that referenced this pull request Oct 15, 2026
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>
@omarchybot omarchybot added the enhancement New feature or request label Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants