Skip to content

test: expand agent-hub + glasses coverage (post-v0.5) - #22

Merged
mrhegemon merged 1 commit into
mainfrom
feat/glasses-ecosystem
Jul 23, 2026
Merged

mrhegemon merged 1 commit into
mainfrom
feat/glasses-ecosystem

Conversation

@mrhegemon

Copy link
Copy Markdown
Member

What

Adds direct unit-test coverage for files that had none despite carrying real production logic, found during a post-merge branch audit (this commit had been pushed to feat/glasses-ecosystem after #21 already merged, so it never got its own PR).

agent-hub (66 → 156 tests):

  • config.ts — every env var's parsing/aliasing/defaulting (CI_LLM_BASE_URL→downstreamUrl w/ /v1 stripping, CI_CLOUD_URL fallback, HERMES_APP_SEED/HERMES_TOKEN precedence, CI_SERVER_API_KEY/CI_SERVER_TOKEN precedence, PORTAL_OIDC_ENABLED boolean parsing, HUB_BIND/HUB_TOKEN interaction, agentKind validation incl. auto).
  • sessions.ts — bind/get/drop + dispose() invocation.
  • sse.ts — SSE frame serialization for every AgentEvent variant.
  • adapters/openclaw.ts — stripForGlasses (fenced code blocks, markdown links), tool-call banner de-duplication, byte-split chunk reassembly, malformed-JSON skip, error paths.
  • adapters/passthrough.ts — API-key header inclusion/omission, malformed-chunk skip, cross-read buffering.

ci-glasses-app (110 → 146 tests):

  • stt/WhisperSTT.ts — had zero coverage despite real multipart-body construction and bearer-precedence logic (token provider > static key > none). Now covers form-data shape, updateConfig, error/network paths.
  • config/Settings.ts — get/set/reset, snapshot-copy semantics, localStorage persistence and resilience (malformed JSON, throwing storage).

Note on Settings.test.ts

This file collided (add/add) with the Settings.test.ts already on main from #19, which had asserted the old oidcClientId default ('ci-hub') — my version had been written before that default flipped to 'ci-even' and would have shipped a stale, soon-to-fail assertion if merged as-is. Reconciled into one file: kept the broader get/set/reset/load/save coverage from this branch, folded in #19's explicit ci-even/issuer/scope checks, and fixed the two stale 'ci-hub' assertions to 'ci-even'. Rebased cleanly onto current main (which already carries hands-free v0.5 from #21).

Testing

Full suites green: agent-hub 156/156, glasses 146/146, typecheck clean in both.

🤖 Generated with Claude Code

…perSTT

Direct unit tests for previously-untested files: agent-hub config.ts (env
parsing/aliasing/defaults for every var incl. CI_LLM_*/CI_CLOUD_URL/HERMES_*/
CI_SERVER_*), sessions.ts (bind/get/drop + dispose call), sse.ts (SSE frame
serialization per AgentEvent type), adapters/openclaw.ts (stripForGlasses,
tool-call banner de-dup, chunk-boundary reassembly, error paths) and
adapters/passthrough.ts (apiKey header inclusion, malformed-chunk skip,
byte-split buffering). Glasses: config/Settings.ts (get/set/reset/persistence)
and stt/WhisperSTT.ts (multipart body shape, bearer precedence, error/network
paths) — WhisperSTT had zero coverage despite real auth logic.

agent-hub 66->156 tests (12 files), glasses 110->143 tests (13 files).
Typecheck clean in both packages.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@mrhegemon
mrhegemon merged commit 016ad0c into main Jul 23, 2026
3 checks passed
@mrhegemon
mrhegemon deleted the feat/glasses-ecosystem branch July 23, 2026 06:44
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