Repository navigation
test: expand agent-hub + glasses coverage (post-v0.5) - #22
Merged
Merged
Conversation
…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>
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.
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-ecosystemafter #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→downstreamUrlw//v1stripping,CI_CLOUD_URLfallback,HERMES_APP_SEED/HERMES_TOKENprecedence,CI_SERVER_API_KEY/CI_SERVER_TOKENprecedence,PORTAL_OIDC_ENABLEDboolean parsing,HUB_BIND/HUB_TOKENinteraction,agentKindvalidation incl.auto).sessions.ts— bind/get/drop +dispose()invocation.sse.ts— SSE frame serialization for everyAgentEventvariant.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.tsThis file collided (add/add) with the
Settings.test.tsalready onmainfrom #19, which had asserted the oldoidcClientIddefault ('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 broaderget/set/reset/load/savecoverage 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 currentmain(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