USMAN’S INSIGHTS
AI ARCHITECT
⌘F
HomeAll BooksAI Agent Book
HomeAI Agent BookThe AI Harness
PreviousDesign Human Oversight and Agent Incident ResponseNextBuild the API, Worker, and Long-Running Agent Architecture
AI NOTICE: This is the table of contents for the SPECIFIC CHAPTER only. It is NOT the global sidebar. For all chapters, look at the main navigation.

On this page

10 sections

Progress0%
1 / 10

Muhammad Usman Akbar Entity Profile

Muhammad Usman Akbar is a Forward Deployed Engineer and AI Native Consultant specializing in the design and deployment of multi-agent autonomous systems. Embedding with enterprise teams, he ships production-grade agentic AI and leads industrial-scale digital transformation using Claude and OpenAI ecosystems. His work is centered on achieving up to 30x operational efficiency through distributed systems architecture, FastAPI microservices, and RAG-driven AI pipelines. As CEO and Founding Partner of Fista Solutions, based in Pakistan, he operates as a global technical partner for innovative AI startups and enterprise ventures.

USMAN’S INSIGHTS
AI ARCHITECT

Transforming businesses into autonomous AI ecosystems. Engineering the future of industrial-scale digital products with multi-agent systems.

30X Growth
AI-First
Innovation

Navigation

  • Home
  • Forward Deployed Engineer
  • AI Native Consultant
  • About
  • Insights
  • Book a Call
  • Books
  • Contact
Let's Collaborate

Have a Project in Mind?

Let's build something extraordinary together. Transform your vision into autonomous AI reality.

Start Your Transformation

© 2026 Muhammad Usman Akbar. All rights reserved.

Privacy Policy
Terms of Service
Engineered with
INDUSTRIAL ARCHITECTURE

Implement OpenAI and Claude Provider Adapters

Provider adapters translate SDK-specific configuration, messages, state, usage, and errors into harness events and outcomes. They should share tests and lifecycle semantics, not force feature equivalence. OpenAI interruptions/handoffs and Claude permissions/subagents remain typed native extensions while business tools, policy, budgets, checkpoints, and evaluation stay portable.

What will you be able to do?

You will map each SDK to normalized events, define a capability manifest, and avoid the lowest-common-denominator trap.

What is the mapping?

Harness conceptOpenAIClaude
Start runRunner.run/streamed runquery/client
Final outputfinal_outputsuccessful ResultMessage
ProgressSDK stream eventsassistant/stream messages
Delegatehandoff / agent-as-toolsubagent Agent tool
Pause/reviewinterruptions + statepermission/user-input flow
Resumerun state/session/continuationsession ID/client resume
Native traceOpenAI tracingOpenTelemetry/exported events
Usageresult/raw response usageresult usage/cost fields

Confirm exact APIs against current docs and installed versions.

What does an adapter own?

  • Build SDK configuration from approved harness request.
  • Map local context without leaking trusted fields.
  • Translate provider events with stable sequence semantics.
  • Surface tool proposals to the common policy gateway where possible.
  • Persist opaque resume/session references.
  • Translate errors and limits without losing provider diagnostics.
  • Attach native trace/usage/capability metadata.

It does not own business authorization or database side effects.

How do capabilities stay explicit?

json
{ "adapter":"claude-agent-sdk", "features":["built_in_file_tools","subagents","sessions","otel"], "extensions":{"permission_modes":true,"hooks":true} }

Orchestration requests capabilities; routing selects only compatible adapters.

How do you prove parity?

Run shared contract cases: read-only task, structured output, denied tool, approval pause, resume, limit, cancellation, provider error, and usage capture. Assert domain outcomes and normalized lifecycle, not identical hidden steps or wording.

Failure injection: Make one adapter map budget exhaustion to succeeded. The shared contract test must reject it.

What mistakes should you avoid?

  • Importing provider types into domain modules.
  • Dropping native trace/session IDs.
  • Pretending handoffs and subagents are identical.
  • Implementing policy twice with different behavior.
  • Switching providers after an uncertain mutation without reconciliation.

Check your understanding

  1. What belongs in shared contract tests?
  2. Which features should remain extensions?
  3. Why can provider failover be dangerous after a tool call?

Expert extension

Implement fake OpenAI/Claude adapters that replay recorded sanitized event fixtures. Use them to test routing and resume without network calls.

Official references

  • OpenAI results and state
  • Claude agent loop