Skip to content

Add Plugin API v3.6.0 config reload support#5

Merged
dmortondev merged 1 commit intomainfrom
config-reload-support
Mar 7, 2026
Merged

Add Plugin API v3.6.0 config reload support#5
dmortondev merged 1 commit intomainfrom
config-reload-support

Conversation

@dmortondev
Copy link
Copy Markdown
Collaborator

Summary

Implements the Config Reload request/response pair from Plugin API v3.6.0 (Launcher v2.19.0), allowing the Launcher to request plugins to reload their configuration at runtime without restarting.

  • Add ConfigReloadablePlugin optional interface — plugins implement ReloadConfig(ctx context.Context) error to handle reload requests
  • Add ConfigReloadError type for classified reload failures (Load, Validate, Save) and ConfigReloadErrorType enum
  • Plugins that don't implement ConfigReloadablePlugin automatically send a success response
  • Wire protocol: message type 202, response includes errorType (int enum) and errorMessage (string)

Changes

Area Files
API types api/types.go, api/types_test.go
Protocol internal/protocol/rpc.go, internal/protocol/stream.go, internal/protocol/rpc_test.go
Plugin interface & handler launcher/launcher.go, launcher/launcher_test.go
Test utilities plugintest/mocks.go
Docs AGENTS.md, README.md, CHANGELOG.md, docs/API.md, docs/ARCHITECTURE.md, docs/GUIDE.md

Design decisions

  • Optional interface pattern: Follows existing BootstrappedPlugin, MultiClusterPlugin, and LoadBalancedPlugin patterns — type assertion in the handler dispatch
  • Error classification: ReloadConfig returns error; plugins return *ConfigReloadError for classified errors (Load/Validate/Save) or plain error for unclassified failures (mapped to ReloadErrorUnknown)
  • RequestFromJSON export: Renamed from requestFromJSON to enable handler dispatch tests without depending on internal struct construction

Test plan

  • just build — compiles cleanly
  • just test — all tests pass (16 new tests)
  • just lint — 0 issues
  • just build-examples — examples still build
  • Protocol round-trip: ConfigReloadRequest deserializes from JSON, ConfigReloadResponse serializes with correct messageType, errorType, errorMessage
  • Handler dispatch: not-implemented (auto-success), success, ConfigReloadError, plain error, wrapped ConfigReloadError
  • ConfigReloadErrorType.String() covers all enum values plus invalid input

@dmortondev dmortondev force-pushed the config-reload-support branch from b1f13d3 to 42bbf46 Compare March 6, 2026 06:07
Implement the Config Reload request/response pair from Plugin API v3.6.0
(Launcher v2.19.0), allowing the Launcher to request plugins to reload
their configuration at runtime without restarting.

Wire protocol:
- Message type 202 for both request and response
- Response includes errorType (enum) and errorMessage (string)
- Non-streaming request-response pattern

SDK changes:
- Add ConfigReloadErrorType enum with Unknown/None/Load/Validate/Save
- Add ConfigReloadRequest/ConfigReloadResponse protocol types
- Add ConfigReloadablePlugin optional interface (ReloadConfig method)
- Add ConfigReloadError type for classified error reporting
- Auto-respond with success for plugins that don't implement the interface
- Export RequestFromJSON for test access to protocol deserialization

Testing:
- Protocol serialization/deserialization tests
- Handler dispatch tests (not implemented, success, typed error,
  plain error, wrapped error)
- ConfigReloadErrorType.String() tests
- Mock ResponseWriter support for config reload

Documentation:
- Update version references (v3.5 → v3.6) across docs
- Add configuration reloading section to GUIDE.md
- Update CHANGELOG.md with feature description
@dmortondev dmortondev force-pushed the config-reload-support branch from 42bbf46 to f40ecee Compare March 6, 2026 06:13
@dmortondev dmortondev merged commit b92fc5a into main Mar 7, 2026
11 checks passed
@dmortondev dmortondev deleted the config-reload-support branch March 7, 2026 02:24
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