Skip to content

Conversation

@timothymarois
Copy link
Contributor

Introduces toArray() and fromArray() methods to AgentContext for serializing and restoring context data, enabling safe transport through Laravel queues. Updates PendingAgentRequest with a withContext() method for applying deserialized contexts. Documentation and comprehensive tests are added to clarify and verify the serialization process, including handling of runtime-only properties.

Introduces toArray() and fromArray() methods to AgentContext for serializing and restoring context data, enabling safe transport through Laravel queues. Updates PendingAgentRequest with a withContext() method for applying deserialized contexts. Documentation and comprehensive tests are added to clarify and verify the serialization process, including handling of runtime-only properties.
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Introduces comprehensive tests for the withContext method, verifying immutable application, property propagation, chaining with other methods, and queue serialization round-trip. These tests ensure that context properties such as messages, variables, metadata, provider/model overrides, tools, prism calls, prism messages, mcpTools, and prismMedia are correctly handled.
@timothymarois timothymarois merged commit 4bc013b into main Jan 27, 2026
4 checks passed
@timothymarois timothymarois deleted the agent-context branch January 27, 2026 23:21
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