feat: Hermes architecture, Agentic UI, and CLI optimizations - #1147
feat: Hermes architecture, Agentic UI, and CLI optimizations#1147Fahremback wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 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".
| if (toolName === 'write_todos') { | ||
| try { | ||
| require('child_process').execSync('git add -A && git commit -m "freebuff auto-checkpoint: meta atualizada"', { stdio: 'ignore' }) | ||
| } catch (e) {} |
There was a problem hiding this comment.
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 👍 / 👎.
| const missionPath = path.join(getProjectRoot() ?? process.cwd(), '.freebuff', 'mission.json') | ||
| if (fs.existsSync(missionPath)) { |
There was a problem hiding this comment.
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 } |
There was a problem hiding this comment.
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 👍 / 👎.
| return `${name} · ${describeConfig(config)} · ${active}` | ||
| }) | ||
| .join('\n') | ||
| } |
There was a problem hiding this comment.
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 👍 / 👎.
| }) | ||
|
|
||
| test('ships the OMP-inspired action harness and DeepSeek-specific profile', () => { | ||
| expect(base3FreeDeepseek.systemPrompt).toContain('Mission execution contract') |
There was a problem hiding this comment.
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 👍 / 👎.
087fac0 to
13a6ee1
Compare
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.