The /api/stats response always returns a 1-byte local_hash (0x19) regardless of the configured path_hash_mode.
Current behavior
engine.py line ~975 (feat/companion):
"local_hash":f"0x{self.local_hash:02x}",
self.local_hash is set in main.py line 127 as pubkey[0] — always the first byte. The 3-byte local_hash_bytes = pubkey[:3] exists (line 128) but is never used in the stats response.
Same pattern for identity hashes throughout api_endpoints.py — all use get_public_key()[0] with 02X formatting.
Requested change
When config.mesh.path_hash_mode is 1 (2-byte) or 2 (3-byte), format local_hash using the corresponding width from local_hash_bytes:
Mode 0: 0x19 (1-byte, current behavior)
Mode 1: 0x1927 (2-byte)
Mode 2: 0x192722 (3-byte)
Same for identity hashes in /api/identities, /api/acl_clients, /api/room_clients, etc.
## Summary
The `/api/stats` response always returns a 1-byte `local_hash` (`0x19`) regardless of the configured `path_hash_mode`.
## Current behavior
`engine.py` line ~975 (`feat/companion`):
```python
"local_hash": f"0x{self.local_hash:02x}",
```
`self.local_hash` is set in `main.py` line 127 as `pubkey[0]` — always the first byte. The 3-byte `local_hash_bytes = pubkey[:3]` exists (line 128) but is never used in the stats response.
Same pattern for identity hashes throughout `api_endpoints.py` — all use `get_public_key()[0]` with `02X` formatting.
## Requested change
When `config.mesh.path_hash_mode` is `1` (2-byte) or `2` (3-byte), format `local_hash` using the corresponding width from `local_hash_bytes`:
- Mode 0: `0x19` (1-byte, current behavior)
- Mode 1: `0x1927` (2-byte)
- Mode 2: `0x192722` (3-byte)
Same for identity hashes in `/api/identities`, `/api/acl_clients`, `/api/room_clients`, etc.
<!-- github-sync-id:4050461200 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The
/api/statsresponse always returns a 1-bytelocal_hash(0x19) regardless of the configuredpath_hash_mode.Current behavior
engine.pyline ~975 (feat/companion):self.local_hashis set inmain.pyline 127 aspubkey[0]— always the first byte. The 3-bytelocal_hash_bytes = pubkey[:3]exists (line 128) but is never used in the stats response.Same pattern for identity hashes throughout
api_endpoints.py— all useget_public_key()[0]with02Xformatting.Requested change
When
config.mesh.path_hash_modeis1(2-byte) or2(3-byte), formatlocal_hashusing the corresponding width fromlocal_hash_bytes:0x19(1-byte, current behavior)0x1927(2-byte)0x192722(3-byte)Same for identity hashes in
/api/identities,/api/acl_clients,/api/room_clients, etc.I have add this with commit
155575865afixed!