Add structured task/step payload support for BYOA adapters#137
Merged
jbarnes850 merged 3 commits intomainfrom Nov 7, 2025
Merged
Add structured task/step payload support for BYOA adapters#137jbarnes850 merged 3 commits intomainfrom
jbarnes850 merged 3 commits intomainfrom
Conversation
Enable BYOA adapters to access structured task and step context through
metadata, supporting integration with test harnesses, simulation environments,
and deterministic execution scenarios.
Changes:
- Student persona: Pass task_payload in planning metadata (personas/student.py)
- Student persona: Store lightweight step_payload in ExecutionContext (personas/student.py)
- LangChain bridge: Opportunistically enrich metadata from ExecutionContext (langchain_bridge.py)
- Add example BYOA adapter demonstrating structured payload usage (examples/)
- Add comprehensive test coverage for structured payloads (tests/)
- Add documentation for BYOA developers (docs/sdk/)
Metadata additions (backward compatible):
- task_payload: Original task string (available in all phases)
- step_payload: {step_id, description, depends_on} (execution phase only)
Impact:
- Existing adapters: Unaffected, ignore unknown metadata keys
- Python adapters: Can optionally use structured payloads
- LiteLLM adapters: Continue extracting only known fields
- Payload size: ~500 bytes - 2KB per step (lightweight)
Resolves: Arc-Computer/CL-Bench#45
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds opt-in structured task and step payload passing to BYOA adapters, enabling integration with test harnesses and deterministic execution environments while protecting LLM-based adapters from data leakage.
Key Changes:
- Introduces
supports_structured_payloadsflag on adapters to control metadata enrichment - Passes
task_payloadandstep_payloadthrough metadata to opt-in adapters during planning and execution phases - Uses LangGraph config metadata to avoid race conditions in concurrent step execution
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| atlas/connectors/registry.py | Adds supports_structured_payloads class attribute (default False) to AgentAdapter base class |
| atlas/connectors/python.py | Sets supports_structured_payloads = True for Python adapters to enable BYOA integration |
| atlas/connectors/http.py | Sets supports_structured_payloads = True for HTTP adapters (remote BYOA services) |
| atlas/connectors/langchain_bridge.py | Enriches metadata with task/step payloads from ExecutionContext when adapter opts-in |
| atlas/personas/student.py | Passes task payload during planning and step payload during execution via config metadata |
| tests/unit/test_structured_payloads.py | Comprehensive test coverage for payload passing, concurrency safety, and backward compatibility |
| examples/byoa_structured_adapter.py | Example adapters demonstrating structured payload usage patterns |
| docs/sdk/structured_adapter_payloads.md | Complete documentation with use cases, best practices, and migration guide |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds opt-in structured task and step payload support for BYOA adapters, enabling integration with test harnesses and simulation environments without requiring prompt parsing.
Problem
Arc CRM benchmark integration (arc-crm-benchmark#45) requires access to structured execution context to reconstruct test harness turn data. Current implementation only passes natural language prompts to adapters, forcing brittle prompt parsing.
Solution
Added capability flag system (
supports_structured_payloads) that gates structured metadata enrichment:Changes
Core Implementation
registry.py: Addedsupports_structured_payloadsflag to AgentAdapter base classpython.py: Enabled flag for PythonAdapterlangchain_bridge.py: Gate metadata enrichment with capability checkstudent.py: Pass step_payload via LangGraph config per invocationMetadata Additions
Testing
Documentation
Security & Privacy
Performance
Backward Compatibility
Fully backward compatible:
Testing
All tests passing:
Resolves
Arc-Computer/CL-Bench#45