testInvocationContext
fun testInvocationContext(agent: ERROR CLASS: Symbol not found for BaseAgent = DummyAgent(), session: ERROR CLASS: Symbol not found for Session = testSession(), runConfig: ERROR CLASS: Symbol not found for RunConfig?? = RunConfig(), invocationId: String = "test-invocation-id", branch: String? = null, sessionService: ERROR CLASS: Symbol not found for SessionService?? = null, artifactService: ERROR CLASS: Symbol not found for ArtifactService?? = null, memoryService: ERROR CLASS: Symbol not found for MemoryService?? = null, resumabilityConfig: ERROR CLASS: Symbol not found for ResumabilityConfig?? = null, userContent: ERROR CLASS: Symbol not found for Content?? = null): ERROR CLASS: Symbol not found for InvocationContext
An InvocationContext populated with sensible defaults for tests.
Most tests only care about a single field (e.g. the agent, or a particular service); this helper lets the test specify just the fields it cares about and inherit the rest from a test-canonical baseline:
session =testSession()(("test_app_name", "test_user_id", "test_session_id"))runConfig =RunConfig()agent =DummyAgent()(defaults to name"test-agent")invocationId = "test-invocation-id"
Service params (sessionService, artifactService, memoryService) default to null, matching the production InvocationContext defaults; tests that exercise a service should pass one explicitly (e.g. sessionService = InMemorySessionService()).
Override any default with a named argument:
val context = testInvocationContext(agent = myAgent, memoryService = recording)Content copied to clipboard