fix: bound non-git auto_index (#713) + complete OpenHands settings/profile registration (#1826) - #2116
Open
DeusData wants to merge 4 commits into
Open
fix: bound non-git auto_index (#713) + complete OpenHands settings/profile registration (#1826)#2116DeusData wants to merge 4 commits into
DeusData wants to merge 4 commits into
Conversation
…git ls-files (#713) auto_index_limit was bypassed for a non-git root because the admission guard counted `git ls-files`, which is 0 outside a repo, so the whole tree was walked into tens of GB of RAM. Bound the check by the discovery layer's bounded count with the limit as the ceiling; a non-git root over the limit is refused with the limit named, and git roots are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
…g + agent-profile refs) (#1826) install wrote only part of the OpenHands config. Register the server globally under ~/.openhands/settings.json -> mcp_config {transport:stdio, command, enabled} (owned-entry, unrelated content preserved), and add "codebase-memory-mcp" to each ~/.openhands/agent-profiles/<p>.json mcp_server_refs array (null -> [it], existing -> appended once). uninstall removes exactly what it added. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
CI's clang-format-20 flagged continuation-line alignment in the new OpenHands MCP install/uninstall helpers (cbm_build_openhands_mcp_entry, cbm_upsert_openhands_settings_mcp, cbm_remove_openhands_settings_mcp, openhands_update_profile_refs). Reformat only those regions with clang-format-20 to satisfy the lint gate; whitespace-only, no behaviour change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
…ex thread (LSan) cbm_kind_in_set lazily builds a THREAD-LOCAL node-type bitset cache during extraction. That cache must be freed before a worker thread exits, or the calloc'd bitsets are orphaned when the thread's TLS is torn down and LeakSanitizer reports them at process exit. Parallel workers already free it (pass_parallel.c:993) and the main thread frees it at process teardown; the IN-PROCESS sequential auto-index runs extraction on autoindex_thread — a short-lived pthread joined by cbm_mcp_server_free — and was the one gap: it built the cache but never freed it (360 bytes in 9 allocations leaked, all from ks_build). This is a PRE-EXISTING latent leak: the extraction path and autoindex_thread are byte-identical to main. It is newly EXPOSED by #713's new autoindex_limit_admits_non_git_root_under_limit test, the first LSan-observed path that runs an in-process auto-index and joins the worker thread in-process — so the fix ships with the test that exposes it. Free the calling thread's bitset cache after cbm_pipeline_free(p), mirroring the established per-worker-thread teardown. Zero behavior change to the CLI/main path. macOS LSan lane, mcp suite: 360 B / 9 allocations -> 0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two independent install/index fixes.
#713 — non-git
auto_index_limitbypass. The auto-index admission guard countedgit ls-files, which is 0 outside a repo, soauto_indexin a non-git folder walked the whole tree into tens of GB of RAM regardless of the configured limit. The check is now bounded by the discovery layer's bounded count with the limit as the ceiling: a non-git root over the limit is refused with the limit named, git roots keep today's behaviour. Test: a non-git root at limit+1 is refused, limit-1 admitted, a git root unchanged.#1826 — OpenHands integration was incomplete.
installnow registers the server globally in~/.openhands/settings.jsonundermcp_config→codebase-memory-mcp{transport:"stdio", command:<exe>, enabled:true}(owned entry; unrelated keys preserved byte-for-byte), and adds"codebase-memory-mcp"to every~/.openhands/agent-profiles/<profile>.jsonmcp_server_refsarray (null→[it], existing list → appended once, never duplicated).uninstallremoves exactly what it added. The title's "agent canvas" had no body and is not addressed here.Local verification (macOS): build clean;
mcp,agent_clients,cli,config_json_likesuites pass; the new tests reference the new symbols so they are non-vacuous. (RED-on-revert was run by the authoring lane; re-confirmation is the CI matrix here.)🤖 Generated with Claude Code