Fix heartbeat tool access via callback pattern#39
Merged
Conversation
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Co-authored-by: yiwang <142937+yiwang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix heartbeat functionality not working
Fix heartbeat tool access via callback pattern
Feb 19, 2026
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.
Heartbeat couldn't execute file operations or bash commands because these tools are defined in
localgpt-clibut heartbeat runs inlocalgpt-core. Core cannot import CLI (circular dependency).Solution
Added optional
ToolFactorycallback to inject CLI tools without reversing dependency graph:Changes
Core crate (
localgpt-core/src/heartbeat/)ToolFactorytype alias and optional field toHeartbeatRunnernew_with_gate_and_tools()constructor accepting tool factoryrun_once()before executionCLI crate (
localgpt-cli/src/cli/daemon.rs)create_cli_tools()as factory when spawning heartbeatheartbeattest commandArchitecture preserved
new_with_gate()calls unchangedWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
cdn.pyke.io/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-4fb9e0debc451c7c/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-4fb9e0debc451c7c/build-script-main /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libobject-49a13cd1c17ee472.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libmemchr-80c0d200aa1c5414.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libaddr2line-ed0d1665fe189213.rlib /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libgimli-82f3ba019c4b6344.rlib 89/out/libaws_lc_0_37_1_crypto.a 89/out/8f1694c3e3041570-bignum_montinv_p256.o 89/out/8f1694c3e3041570-p256_montjscalarmul.o 89/out/8f1694c3e3041570-p256_montjscalarmul_alt.o 89/out/4433246e317b5e42-bignum_add_p384.o 89/out/4433246e317b5e42-bignum_deamont_p384.o 89/out/4433246e317b5e42-bignum_deamont_p384_alt.o 89/out/4433246e317b5e42-bignum_littleendian_6.o 89/out/4433246e317b5e42-bignum_montinv_p384.o 89/out/4433246e317b5e42-bignum_montmul_p384.o 89/out/4433246e317b5e42-bignum_montmul_p384_alt.o 89/out/4433246e317b5e42-bignum_montsqr_p384.o 89/out/4433246e317b5e42-bignum_montsqr_p384_alt.o 89/out/4433246e317b5e42-bignum_neg_p384.o 89/out/4433246e317b5e42-bignum_nonzero_6.o(dns block)/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-4fb9e0debc451c7c/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-4fb9e0debc451c7c/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02--check-cfg /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02cfg(docsrs,test) /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02--check-cfg /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02cfg(feature, values()) /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02-C /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02metadata=5a6abc964901ce63 /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e02-C 4390.darling_macro.a7bbcfd54d42fa82-cgu.0.rcgu.o /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e0289/o�� 4390.dgvm9xnnq9ds8yk0ditabp8m1.rcgu.o /home/REDACTED/work/localgpt/localgpt/target/debug/build/aws-lc-sys-e0caf0de8a4e0289/out/ebcd52e9457b6221-x509rset.o 89/o�� 75a994.rlib .rlib ib a42b.rlib ib rlib 35072.rlib(dns block)/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-64084d033ce2d210/build-script-main /home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-64084d033ce2d210/build-script-main -Wl,-Bstatic /home/REDACTED/work/localgpt/localgpt/target/debug/deps/liblzma_rust2-3b5a6f8c5e7b/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libstrsim-8da5906b5f32b006.rlib /home/REDACTED/work/localgpt/localgpt/target/debug/deps/libhmac_sha256-3c934aca59d/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libfnv-1215859a684cad45.rlib /home/REDACTED/work/localgpt/localgpt/target/debug/deps/libureq-56fca58f43c2d6a0.r/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libident_case-0f6ad5d47d62a42b.rlib /home/REDACTED/work/localgpt/localgpt/target/debug/deps/libwebpki_root_certs-88cb8/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libsyn-5a31f41abc6c2f2a.rlib 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.00/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libquote-819bddae12a512e2.rlib 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.01/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libproc_macro2-7e8392b0e59a7afb.rlib 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.02/home/REDACTED/work/localgpt/localgpt/target/debug/deps/libunicode_ident-6c344b3cd407a301.rlib 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.03.rcg�� 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.04.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.05.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.06.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.07.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.08.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.09.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.10.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.build_script_build.31ee2bb2b9f3792a-cgu.11.rcgu.o 2/build_script_build-6aa26c3c24d36ad2.8rpuk2rak7x34azvbpj96633z.rcgu.o rgo/registry/src/home/REDACTED/work/localgpt/localgpt/target/debug/build/ort-sys-64084d033ce2d210//tmp/rustcea7Bnz/rmeta.o(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.