Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ infographic/
infographics/
infograficos/
infografico/
build/
native/fts5_cjk/*.so
# Runtime marker written by hermes update when a lazy dependency refresh is
# interrupted; consumed by launch-time recovery. Never commit it (was tracked
# by accident via 3a69e34702, removed in the #72002 salvage).
.lazy-refresh-incomplete
.kimix_cache/
227 changes: 127 additions & 100 deletions FORK_NOTES.md

Large diffs are not rendered by default.

285 changes: 203 additions & 82 deletions FORK_NOTES.zh-CN.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions agent/agent_runtime_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2990,6 +2990,7 @@ def _execute(next_args: dict) -> Any:
_todo_tool(
todos=next_args.get("todos"),
merge=next_args.get("merge", False),
auto_fix=next_args.get("auto_fix", True),
store=agent._todo_store,
),
next_args,
Expand Down
59 changes: 16 additions & 43 deletions agent/coding_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,53 +215,26 @@ def _edit_format_line(model: Optional[str]) -> str:
# search_files, patch, write_file, terminal, todo) are in the coding toolset and
# in _HERMES_CORE_TOOLS, so they're present on every surface this fires on.
CODING_AGENT_GUIDANCE = (
"You are a coding agent pairing with the user inside their codebase. "
"Operate like a careful senior engineer.\n"
"You are a coding agent pairing with the user inside their codebase.\n"
"\n"
"Gather context first:\n"
"- Read the relevant files with `read_file` and locate code with "
"`search_files` before changing anything. Trace a symbol to its definition "
"and usages rather than guessing its shape.\n"
"- Batch independent lookups: when several reads/searches don't depend on "
"each other, issue them together in one turn instead of one at a time.\n"
"- Never invent files, symbols, APIs, or imports. If you haven't seen it in "
"the repo, go look. Don't assume a library is available — check the project "
"manifest (pyproject.toml / package.json / Cargo.toml / go.mod) and how "
"neighbouring files import it.\n"
"Context first: read with `read_file`, locate with `search_files` before changing; "
"never invent files, symbols, APIs, or imports; batch independent lookups; "
"check the project manifest (pyproject.toml/package.json/Cargo.toml/go.mod) for deps.\n"
"\n"
"Make changes through the tools, not the chat:\n"
"- Edit with `patch`/`write_file`. Do NOT print code blocks to the user as "
"a substitute for editing — apply the change, then summarise it. Only show "
"code when the user explicitly asks to see it.\n"
"- Match the project's existing style and conventions; AGENTS.md / "
"CLAUDE.md / .cursorrules already in context win over your defaults. Touch "
"only what the task needs — no drive-by refactors, renames, or reformatting "
"— and add any imports/dependencies your code requires.\n"
"- If an edit fails to apply, re-read the file to get the current exact "
"contents before retrying — don't repeat a stale patch. If the same region "
"fails twice, rewrite the enclosing function or file with `write_file` "
"instead of attempting a third patch.\n"
"Change via tools, not chat: edit with `patch`/`write_file` — never print code blocks as a "
"substitute; apply, then summarise. Match project style (AGENTS.md/CLAUDE.md/.cursorrules win); "
"no drive-by refactors; add the imports/deps your code requires. If an edit fails, re-read for "
"current exact contents; after two failed patches, rewrite the function/file with `write_file`.\n"
"\n"
"Verify, and know when to stop:\n"
"- Use `terminal` for git, builds, tests, and inspection. Run the relevant "
"tests/linter/build and confirm they pass before claiming the work is done.\n"
"- Terminal state persists across calls: current directory and exported "
"environment variables carry forward. Activate a virtualenv or export setup "
"vars once, then reuse that state instead of re-sourcing it before every "
"test command.\n"
"- Fix root causes, not symptoms: when you find a bug, check sibling call "
"paths for the same flaw and fix the class, not just the reported site.\n"
"- When fixing linter/type errors on a file, stop after about three "
"attempts on the same file and ask the user rather than looping.\n"
"- Track multi-step work with `todo`. Reference code as `path:line` instead "
"of pasting whole files.\n"
"Verify and stop: use `terminal` for git/builds/tests; confirm tests/linter/build pass before "
"claiming done. Terminal state persists across calls: cwd and exported env vars carry forward. "
"Activate a virtualenv or export setup vars once, then reuse instead of re-sourcing it before "
"every test command. Fix root-cause classes — check sibling call paths. Stop after ~3 linter "
"attempts on a file, then ask. Track multi-step work with `todo`; reference code as `path:line`.\n"
"\n"
"Respect the user's repo: don't commit, push, or rewrite history unless "
"asked, and never read, print, or commit secrets — leave `.env` and "
"credential files alone unless the user explicitly asks. The Workspace "
"block below is a snapshot from session start — re-run `git status`/"
"`git branch` before relying on it. Be concise: lead with the change or "
"answer, not a preamble."
"Respect the repo: no commit/push unless asked; never read, print, or commit secrets — leave "
"`.env`/credential files alone. Workspace snapshot is from session start — re-run `git status`/"
"`git branch` before relying on it. Be concise."
)


Expand Down
1 change: 1 addition & 0 deletions agent/tool_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@ def _execute(next_args: dict) -> Any:
return _todo_tool(
todos=next_args.get("todos"),
merge=next_args.get("merge", False),
auto_fix=next_args.get("auto_fix", True),
store=agent._todo_store,
)
function_result, function_args, middleware_trace, _execution_blocked, _execution_dispatched = _managed_values(_run_agent_tool_execution_middleware(
Expand Down
20 changes: 11 additions & 9 deletions apps/desktop/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4196,25 +4196,27 @@
}

// On Windows, preflight the configured shell. When the user has set
// shell:bash, verify Git Bash is installed (no auto-download). Otherwise
// shell:bash, verify Git Bash is installed (no auto-download); a missing
// Git Bash is NOT fatal — the core terminal falls back to PowerShell
// (pwsh → powershell.exe), so warn and continue. Otherwise
// (auto/pwsh/powershell), check that PowerShell is available — it ships
// with every Windows 10/11 system so the check is confirmatory.
if (IS_WINDOWS) {
const configShell = (process.env.HERMES_SHELL_TYPE || 'auto').toLowerCase().trim()
const useBash = configShell === 'bash'

if (useBash) {
if (!findGitBash()) {
throw new Error(
'You have configured shell:bash, but Git for Windows (Git Bash) was not found. ' +
'Install it from https://git-scm.com/download/win and ensure it is on your PATH, ' +
'then relaunch Hermes. Alternatively, set shell to "auto", "pwsh", or "powershell" ' +
'to use PowerShell (the default shell on Windows).'
if (useBash && findGitBash()) {
// Git Bash found — it will be used, nothing more to verify.
} else {
if (useBash) {
console.warn(
'[hermes] You have configured shell:bash, but Git for Windows (Git Bash) was not found. ' +
'Hermes will fall back to PowerShell. Install it from https://git-scm.com/download/win ' +
'and ensure it is on your PATH to use Git Bash, or keep the default shell "auto".'
)
}
} else {
// Verify at least one PowerShell is available (ships with every Windows system).
const hasPowerShell =

Check warning on line 4219 in apps/desktop/electron/main.ts

View workflow job for this annotation

GitHub Actions / JS & TS checks / apps/desktop / check:lint

Expected blank line before this statement
findOnPath('pwsh.exe') ||
findOnPath('pwsh') ||
(() => {
Expand Down
Loading
Loading