chore(repo): remove unused code - #3007
Merged
nicoloboschi merged 7 commits intoJul 29, 2026
Merged
Conversation
Remove confirmed unreferenced helpers from the API and engine. Delete tests only where they cover superseded internal paths. Keep active test helpers and public memory operations unchanged.
Remove dead CLI configuration, client, and output helpers. Drop the parser implementation and tests used only by the retired output path.
Remove unused ControlPlaneClient methods and unreachable directive detail state from the think view.
Remove unreferenced benchmark and repository maintenance helpers.
Remove the unused daemon port lookup helper while preserving current profile-based daemon discovery.
Remove unreferenced helpers across supported integrations. Drop tests only for retired internal paths and retain active test and lifecycle infrastructure.
Sanderhoff-alt
force-pushed
the
agent/remove-unused-code
branch
from
July 28, 2026 06:46
9cd4fdb to
ed2c8db
Compare
Sanderhoff-alt
marked this pull request as ready for review
July 28, 2026 06:53
The dead-code cleanup removed build_batch_consolidation_prompt and its tests,
but those tests guarded behaviors that are still live in the current
build_consolidation_system_prompt / build_consolidation_input path:
- brace-safety of a mission / capacity note containing literal { } (a lone
brace would raise KeyError in the internal str.format() and crash
consolidation)
- output-language directive injection into the cached system prompt
- the built-in default mission when none is supplied
Re-add these as regression tests against the current builders instead of
dropping the coverage. Also fix a stale comment referencing the removed
utils.extract_facts module.
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.
Summary
Remove confirmed dead code across the API, CLI, control plane, developer tooling, embed package, and integrations.
Candidates were checked against package exports, framework registration, CLI dispatch, extension hooks, generated clients, documentation, and repository-wide references. Test-only symbols were removed only when their tests covered a production path that has already been superseded.
Zero-reference cleanup
color_mid;start_embedded_postgres;stop_embedded_postgres; orphanedget_embedded_postgres;IdleTimeoutMiddleware.start_idle_checker;check_daemon_runningmap_facts_to_chunks;_create_memory_links;BudgetedOperation.acquire_many;RetainBatch.get_facts_for_content;RetainBatch.get_chunks_for_content;ProcessedFact.is_duplicate;ExtractedFact.build_fact_text; Oracle_limit_to_rownumcallbackformat_entity_summaries_for_prompt;EntityResolver.get_units_by_entity;EntityResolver.get_entity_by_text;build_delta_prompt;build_agent_promptMemoryEngine._acquire_connection;SearchTracer.add_neighbor_link;SearchTrace.get_search_path_to_node;SearchTrace.get_nodes_by_link_type;SearchTrace.get_entry_point_nodescheck_migration_statusApp.toggle_auto_refresh;Config.from_env;Config.save_api_url;utils.get_client;utils.get_output_format; emptyutils.rsmoduleControlPlaneClient.regenerateEntityObservations;setBankMission;updateBankProfile;getObservation; unreachable directive-detail state and panelBenchmarkRunner._agent_has_data;camel_to_snake;update_sidebarsget_daemon_portget_turn_countimplementations in Claude Code, Codex, Cursor, Cursor CLI, and Zcodefind_workdir; LiteLLM_check_pending_storage_errors;HindsightCallback._messages_to_query; CursorHindsightClient.health_check; Cursorstop_daemon; Devin Desktopdefault_mcp_pathSuperseded test-only paths
These implementations and their dedicated old-path tests are removed together.
generate_embeddingbuild_batch_consolidation_promptcompute_temporal_query_boundscompute_temporal_linksengine.utils.extract_factsretain/fact_extraction.py; empty module removedHindsightClient.health_checkHindsightClient.health_checkHindsightClient.health_checkHindsightClient.health_checkcountUserTurnsgetRetentionTurnIndexdefaultApiKeyEnvVarOutputFormat::from_strImpact
No public API, generated SDK surface, registered route, CLI command, extension hook, or documented integration contract is intentionally removed. This reduces maintenance surface without replacing current production paths.
Commit structure
chore(api): remove unused codechore(cli): remove unused codechore(control-plane): remove unused codechore(dev): remove unused codechore(embed): remove unused codechore(integrations): remove unused codeValidation
cargo check --all-targets; 66 binary tests passedThe unused-code hook still reports existing unused variables outside this change. Its Knip probe is advisory and cannot load the Astro plugin because the temporary
npxenvironment lackstypescript; the repository lint hook itself completes successfully.