internalflow

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package internalflow centralises the predicate every memory plugin uses to skip recording assistant messages produced by internal sub-flows (planner, classifier router, summariser, compaction, subagent, delegate).

The earlier predicate — "skip when LLMResponse.Metadata[\"_source\"] is non-empty" — was correct until Idea 09 (#83) made every agent main request tag itself with `_source = pluginID` for cost attribution. Provider plugins propagate request metadata onto the response, so under the old predicate every agent main response was silently dropped from history along with its tool_use blocks. Anthropic then rejected the next request with "unexpected tool_use_id found in tool_result blocks".

The fix targets task_kind instead: each internal sub-flow has a stable task_kind value, and main agent loops do not appear in this set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipForCuration

func SkipForCuration(meta map[string]any) bool

SkipForCuration returns true when the request metadata indicates an internal sub-flow whose outgoing LLM request a curation layer should leave alone. Mirrors SkipForHistory but is intended for the before:llm.request side: tool_result_clear, tool_def_pruner, and any other curator should bail when the request originates from a planner, classifier, summariser, compaction, or subagent flow rather than the main agent loop.

func SkipForHistory

func SkipForHistory(meta map[string]any) bool

SkipForHistory returns true when the response metadata indicates an internal sub-flow whose output must not be recorded as part of the user-facing conversation history.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL