Repository navigation
feat(rutis): a go feature — Go plugins through the bridge - #304
Merged
Merged
Conversation
yuanhao
force-pushed
the
feat/rutis-go
branch
from
October 12, 2026 08:56
296abfb to
d9d0e0a
Compare
rutis 0.9 adds Go runtimes: a plugin built with the rutis Go SDK is a binary, one runtime each, started when a `go:<plugin>` row needs it. A Go plugin reaches the `yoagent` host service like any other: - the handler is a map of Go functions (functions cross by reference); - the `signal` field of a hook's first argument decodes as nothing, so typed structs are unaffected; - when the host gives a call up (run cancel, hook timeout, unload), the Go call's context.Context is cancelled — the same contract as a JavaScript hook's AbortSignal. `go = ["rutis-bridge/go"]`; plugins/go/ is a working example (a policy denying `bash`, a slow policy watching ctx.Done(), a `go_echo` tool); tests/go_test.rs builds it with the local Go toolchain and checks the tool, the denial and the cancelled context through GoResolver + GoRuntimes. CI: setup-go 1.24 in the languages job; clippy/doc/test with `go`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
…fails, docs - go_test: a failed `go build` with Go present fails the test (it was a skip); covers an after_tool redaction from Go, Go's denial / returned error / malformed answer each denying, the timeout reason, a run cancel cancelling the Go call's context, and unloading the row removing the handler (the disposer Effect), after which `bash` runs. - plugins/go: `record` reports its own errors on stderr; the doc says a hook's context also ends when the hook returns (the SDK's defer cancel), so watch it only while the call runs; register's missing disposer is an error. - Docs: languages.rs, lib.rs, README handler shapes include Go; CLAUDE.md "decodes as nil"; CI comment. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
yuanhao
force-pushed
the
feat/rutis-go
branch
from
October 12, 2026 09:13
d9d0e0a to
eca3f16
Compare
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.
Contains #303's Bun commit. Merge #303 first; this diff then shrinks to the Go work. (A PR whose base isn't
maingets no CI.)rutis 0.9 adds Go runtimes: a plugin built with the rutis Go SDK is a binary, one runtime each, started when a
go:<plugin>row needs it. A spike showed the bridge's contract holds for Go unchanged, with no upstream change needed:context.Contextis cancelled, the same contract as a JavaScript hook'sAbortSignal.signalfield in a hook's first argument decodes as nothing in Go, so typed structs are unaffected.Changes
go = ["rutis-bridge/go"]; theyoagenthost service's gates include it.plugins/go/is a working example (owngo.mod,go 1.24, rutis Go SDK v0.9.1): abefore_toolthat deniesbash, a slow policy that watchesctx.Done(), and ago_echotool.tests/go_test.rs(required-features = ["go"]) builds it withgo buildand runs it throughGoResolver+GoRuntimes. It checks three things: the Go tool answers; Go's denial stopsbashbefore it runs; and a 300 ms policy timeout cancels Go's context (Go recordsctx.Done()). Without Go 1.24+ it printsSKIPPED:, or fails withYOAGENT_RUTIS_REQUIRE_RUNTIMES=1.actions/setup-go1.24 in the languages job; clippy, doc and test withgo; the MSRV check includes it.Checked locally (Go 1.27.1, Bun 1.4.3, runtimes required): clippy (
go, and all features) and docs clean; every suite passes withnode,python,bun,go,websocket.With #303, yoagent-rutis 0.3.0 runs plugins in Rust, TypeScript (Node or Bun), Python and Go.
🤖 Generated with Claude Code
https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG