mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
ead4afbfe6
- Replace detachedWithCancel (goroutine-based) with context.WithoutCancel + valuesContext; the old goroutine would fire immediately if the parent was already cancelled/deadline-exceeded, causing 'failed after 0s' - Kit.Subagent() pre-flight: if the incoming ctx is already done, reset to context.Background() before applying the subagent timeout - Both Subagent() error paths now return a non-nil *SubagentResult with Elapsed set, so the tool response always shows accurate timing - Narrow viperInitMu scope in Kit.New(): snapshot viper state + call BuildProviderConfig under the lock, then release before SetupAgent / MCP loading; parallel subagent spawns no longer serialise on viper I/O - AgentSetupOptions gains ProviderConfig + scalar fields so SetupAgent can skip viper reads when a pre-built config is supplied - Add subagent_test.go covering the fixed context detachment behaviour