Skip to content

fix: native compress telemetry crashes with UnboundLocalError - #68

Draft
cursor[bot] wants to merge 13 commits into
mainfrom
cursor/critical-bug-investigation-9192
Draft

fix: native compress telemetry crashes with UnboundLocalError#68
cursor[bot] wants to merge 13 commits into
mainfrom
cursor/critical-bug-investigation-9192

Conversation

@cursor

@cursor cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

HiveStack.compress() crashes with UnboundLocalError when all of the following are true:

  • backend="native" (or HIVE_BACKEND=native with hive-cpp installed)
  • An explicit rust_brain is passed (so _native stays enabled)
  • Telemetry is enabled

This breaks native-backend deployments that record compression metrics — a common production configuration.

Root cause

The native compress path builds a result CompressedTurn, but telemetry recording still referenced the Python-only out variable from the non-native branch.

Fix

Record compression telemetry from result fields instead of out.

Validation

  • Added test_native_compress_with_telemetry_does_not_crash
  • pytest tests/test_stack.py tests/test_backend.py — 17 passed, 1 skipped
Open in Web View Automation 

cursoragent and others added 13 commits August 25, 2026 17:30
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>
Explain that HLC tracks event order and cause-and-effect, not just
wall-clock time, so memory stays correctly ordered when messages
arrive late or out of sequence.

Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
HiveStack.compress() native path built `result` but telemetry still
referenced Python-only `out`, causing UnboundLocalError when
backend=native, an explicit rust_brain, and telemetry are enabled.

Record compression metrics from `result` and add a regression test.

Co-authored-by: Daniel <DJLougen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant