Repository navigation
[MC: NN.1.S] Add OpenCode Go, endpoint plugins, and review fixes (Refs OPS-1122) - #556
Conversation
…iew fixes (Refs OPS-1122) - OpenCode Go: documented usage endpoint via the CLI's local auth file - Endpoint plugins: validated JSON descriptors in the Plugins folder, generic bounded reader, SSRF gate, Settings toggles without recompiling - Alibaba/MiMo/Qwen verified against #554/#555 (already on main), docs updated - UI: sentenceGap, accent-ink shortcut, logo fallback from reader list, PiP keyboard/VoiceOver access, larger tertiary labels, keyboard splitter, popup no longer auto-expires for VoiceOver/Reduce Motion, right-click hint - Perf: snapshot-write chain predecessor deadline surfaces a stuck write instead of stalling silently; v2 publisher retries transient 502/503/504
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Automatic approval held Kody's assessment:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Restrict bearerEnv to CODECAPS_PLUGIN_-prefixed variables and name the missing variable in the plugin issue - Refuse non-canonical IP literals (hex/octal/bare-integer/leading-zero) and scope the loopback port exception to loopback hosts only - Reject descriptors with both percent paths; dedicated badDisplayName error - Reject out-of-range percentages instead of clamping them - Cache plugin loads for Settings rows and reader toggles
This comment has been minimized.
This comment has been minimized.
The critical findings behind this request are resolved.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Refs OPS-1122. Refs CC-238 (already landed in #554/#555; verified here, not duplicated).
Summary
Adds built-in OpenCode Go quota monitoring and declarative endpoint plugins, plus review-driven UI, reliability, and accessibility fixes. Refs OPS-1122.
What changed
opencode-gowith 5-hour, weekly, and monthly windows read from OpenCode's usage endpoint using the CLI's locally saved Go key. Missing sign-in reports no windows and no issue; 401/403 and service failures surface as provider issues. New Settings row enables toggling without an app update.~/Library/Application Support/CodeCaps/Plugins/*.json. Descriptors define one GET endpoint, auth as none or Bearer env-var name, and 1–10 windows via restricted JSON paths for remaining/used percent or absolute balances plus reset stamps. Validation refuses reserved provider keys, non-HTTPS endpoints except opted-in loopback, private/metadata literals, userinfo/query/fragment URLs, oversize/invalid files, and duplicates. Plugins register as optional readers withplugin:<slug>ids and flow through existing snapshots, ranking, and toggles.docs/ENDPOINT-PLUGINS.mdand extendeddocs/TOKEN-PLAN-SOURCES.md.Tests added
EndpointPluginTestscovering descriptor validation, SSRF matrix, loopback opt-in, JSON path grammar, generic reader mapping, missing-key behavior, loader fail-closed behavior, and disabled-plugin factory non-invocation.OpenCodeGoQuotaReaderTestscovering percent inversion, rate-limited exhaustion, absent-key behavior, auth wording, unparseable payloads, and auth-file extraction.QuotaPublisherTestswith transient retry and no-retry webhook cases, andSnapshotWriteDrainTestswith predecessor-timeout coverage. Test execution results were not reported, so passing status is unverified.Open review findings / risks
Automated review reported 5 unresolved findings, described here as reported and unverified:
GenericEndpointQuotaReader.swift:48.MonitorModel.swift:1358.GenericEndpointQuotaReader.swift:94.bearerEnvmay allow reading any environment variable inGenericEndpointQuotaReader.swift:29.ConsoleViews.swift:340.DNS-rebinding residual risk for plugins is noted in code comments as trusted local configuration.
Summary
Fixes punctuation in the Console unavailable-source alert. Adds a period after the provider / window identifier before the Sources & Fleet guidance.
Impact
User-visible text correction only with no logic or flow change. Refs OPS-1122.
Verification
No test evidence is included in the provided changes; behavior is unverified.
Refs OPS-1122. Adds endpoint-plugin hardening and a cached loader for UI use.
Changes
CODECAPS_PLUGIN_*environment names with defense-in-depth checks at validation and token read, and updates docs and messaging to reflect the namespaced variable requirement.loadCached()plugin cache and switchesMonitorModeland Settings status rows to it, while refresh continues to use directload().Tests
Open risks
Summary
Refs OPS-1122. Adds review fixes for endpoint plugins: loopback validation, plugin cache handling, and quota percent fallback.
Changes
EndpointPluginDescriptor: strips trailing dot before loopback check solocalhost.and127.0.0.1.remain loopback-restricted and do not fall through to the public path. Port relaxation remains loopback-only.EndpointPluginLoader.loadCached: returns empty without stamping cache when Plugins folder is missing, so a newly created folder is seen on next access. When directory listing fails, serves last good descriptors and retries on next access rather than caching the failure for TTL.GenericEndpointQuotaReader: when reported percent is out-of-range or non-finite, falls back toabsoluteRemaining / absoluteLimit * 100when available. Drops window only when neither source yields an in-range value.Tests
testTrailingDotLoopbackIsRefusedWithoutOptIncoveringlocalhost.and127.0.0.1.validation. AddedtestGenericReaderFallsBackToAbsolutesWhenPercentOutOfRangecovering 140% percent with 30/100 absolutes yielding 30% remaining. Run results and runtime verification remain unverified in this description.Risks / Open review finding
Sources/QuotaCore/EndpointPluginLoader.swift:37— cache lock held across disk scan, serializing callers.Summary
Refs OPS-1122. Updates
EndpointPluginLoaderplugin descriptor caching to reduce lock contention during disk scans.Changes
defaultDirectory.Operational impact
Risks / Open review finding
Sources/QuotaCore/EndpointPluginLoader.swift:46: TTL-expired callers scan plugins concurrently. Behavior under concurrent expired-cache scans remains unverified.Tests
Summary
Refs OPS-1122. This change adds single-flight coordination for
EndpointPluginLoadercache refreshes on TTL expiry.Changes
scanLockto serialize the off-lock directory scan.loadedAtbefore performing disk work.Operational impact
Reduces redundant disk scans when concurrent accesses coincide with TTL expiry, returning one fresh descriptor set to all waiters. No API or behavior change beyond reduced concurrent scan work.
Verification
Automated code review reported no issues. No test evidence is included in the provided changes, and concurrent-refresh behavior remains unverified.