Repository navigation
test: cover gateway policy toolset and reply caps - #179
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
create_gateway_bus applies GatewayPolicy.tools_enabled over a wider top-level list, and gateway.tools_enabled "all" still exposes terminal, write_file, and git_commit. Discord and Twitch outbound replies stay within the declared cap, including a Twitch cut that would start the next chunk with /me. Telegram split tests call the adapter's splitter. Co-authored-by: moikapy <[email protected]>
This branch has not been deployed
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.
Risky behavior now covered
GatewayPolicy.tools_enabled, so a projecttools_enabled: "all"does not exposeterminal,write_file, orgit_commiton the shared gateway agent.gateway.tools_enabled: "all"still opens that full set, includinggit_commit, over a narrow top-level list.GatewayPolicy.allowslogsgateway denied <platform> chat=… user=….PRIVMSGbodies stay within the adapter's declaredmax_reply_chars. A Twitch split that would start the next chunk with/meis stripped before send.split_text(the copysendMessagecalls) and hard-cuts a token with no whitespace atTELEGRAM_CAPABILITIES.max_reply_chars.Test files added/updated
test/gateway.test.tstest/gateway_reconnect.test.tsWhy these tests materially reduce regression risk
#178 declared the policy and the per-platform caps, and the existing tests checked the policy object and the capability literals. They did not run
create_gateway_bus, so dropping thetools_enabledoverride would still leaveterminalandgit_commiton a public gateway while those tests stayed green. Discord and Twitch chunking is private and was untested; Telegram tests importedformat.tssplit_text, which the adapter does not call. A cap regression would post over-length Discord messages or a Twitch chat command created by a mid-string cut.Validation:
node node_modules/vitest/vitest.mjs run test/gateway.test.ts test/gateway_reconnect.test.ts(52 passed) andbun x tsc --noEmit. The full suite was not run; known failures remain in tests that spawnbunor needdist/.