fix: native compress telemetry crash (UnboundLocalError on out) - #67
Draft
cursor[bot] wants to merge 11 commits into
Draft
fix: native compress telemetry crash (UnboundLocalError on out)#67cursor[bot] wants to merge 11 commits into
cursor[bot] wants to merge 11 commits into
Conversation
Tier 1: Add uv.lock, pre-commit, Dependabot, ruff config, Python 3.13 CI, and fix HLC preservation on snapshot restore and gossip replay. Tier 2: Add server/mcp/agents/http optional extras, long-context compression eval script, and CI smoke jobs for MCP and long-context workloads. Tier 3: Wire HIVE_BACKEND in HiveStack, implement LinUCB policy updater, and add httpx async LLM client support. Tier 4: Refresh enterprise roadmap and improvement plan, add pip-audit/SBOM CI jobs, bump Jetson Docker base image, and enable nightly GPU smoke CI. Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Reflect PR #62 changes: new optional extras, HIVE_BACKEND, LinUCB, MCP/server deployment, 200-test CI matrix, uv.lock/pre-commit, and upcoming PFN busyBee training-mode integration. Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
- README outcome table: HLC fix, MCP, long-context eval, HIVE_BACKEND, LinUCB - New docs/WHATS_NEW.md with tier summary and Twitter-ready copy - CHANGELOG [Unreleased] docs entry; dedupe [full] install block in README Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
- Rewrite hive.mcp_server for MCP 2.x MCPServer API (hive-mcp console script) - Add client config generator, installer, and project .cursor/mcp.json - Document setup in docs/MCP_SETUP.md and harness wiring in docs/HARNESS_SETUP.md - Add hive.harness.load_routing_policy() for SWE-bench eval (busyBee or rules) - Add integration tests; 214 tests passing Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
- Add python -m hive.mcp (server default, install subcommand) - Test MCP list_tools/call_tool over stdio subprocess - Validate bundled Claude/Codex snippets against config generator - Run MCP integration tests in CI; update docs to 218 tests Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
HiveStack.compress() native path builds CompressedTurn in result but telemetry still referenced out from the Python branch, causing UnboundLocalError when backend=native, an explicit rust_brain is provided, and telemetry is enabled. Add regression test that mocks native_compress and verifies telemetry recording. Co-authored-by: Daniel <DJLougen@users.noreply.github.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.
Bug and impact
HiveStack.compress()crashes withUnboundLocalError: cannot access local variable 'out'when:backend="native"(orHIVE_BACKEND=native)RustBrainis passed explicitly (so native compression stays enabled)This breaks any native-backend deployment that records compression metrics — including eval harnesses and production observability paths.
Root cause
PR #62 added a native compression branch that builds a
CompressedTurninresult, but the shared telemetry block still referencedout, which only exists on the Python path.Fix
Record telemetry from
resultfields (role, label, original_tokens, compressed_tokens) so both paths share the same code.Validation
native_compressbefore fixtest_native_compress_with_telemetry_does_not_crashpytest tests/test_backend.py tests/test_hlc_snapshot_gossip.py tests/test_stack.py— 21 passed, 1 skipped