CCDV-F Prep unofficial
← All skills

Applications and Integration

Integration Resilience

Exam objective: Analyzing failing or degraded integration code and its error output to find the defect and select a correction consistent with documented API error semantics. Defects include mishandled streaming events and terminal-event semantics, retry and fallback logic that does not distinguish Anthropic's error classes (rate limits, overloaded, invalid request, timeout), and faulty multi-format ingestion through the Files API.

What the exam tests

You are given failing or degraded integration code with its error output. You must locate the defect and pick the correction that matches documented API semantics. Three areas recur: streaming consumers, retry and fallback logic across error classes, and file ingestion.

Key rules

Streaming

  • Event flow: message_start (empty content), then per block content_block_start, deltas, content_block_stop; then message_delta; then message_stop.
  • stop_reason is null in message_start and arrives in message_delta, whose usage counts are cumulative.
  • An error event (for example overloaded_error) can arrive after HTTP 200. SDKs surface it as an exception and do not retry it.
  • Ignore pings and tolerate unknown event types.
  • Tool input arrives as input_json_delta string fragments. Concatenate and parse at block stop:
if delta.type == "input_json_delta":
    buf[event.index] += delta.partial_json   # parse at content_block_stop
  • Resuming an interrupted stream: Claude 4.5 and earlier accept the partial text as an assistant prefill; 4.6 and later need a user message with the partial text asking to continue. Only text is partially recoverable.

Terminal states (successful responses, not errors)

  • max_tokens: truncated; an incomplete tool_use means retrying with a higher limit.
  • model_context_window_exceeded: also treat as truncated.
  • pause_turn: send the assistant content back unchanged with the same tools.
  • refusal: discard partial output; retry on a fallback model (except the reasoning_extraction category, where you change the prompt instead).

Errors

StatusTypeHandling
400invalid_request_errorFix the request (also your own spend limit)
401 / 403authentication / permissionFix credentials or access
404not_found_errorCheck path, IDs, workspace
413request_too_largeShrink the payload
429rate_limit_errorHonor retry-after; check error.details.error_code
500 / 504api_error / timeout_errorRetry with limits; stream long requests
529overloaded_errorBack off and retry
  • SDKs retry twice by default (connection errors, timeouts, 408, 409, 429, 500+), following x-should-retry and retry-after.
  • A ramp limit 429 (ramp_limit_exceeded) means traffic grew too fast: wait, then increase gradually.
  • Server-side fallbacks reacts only to classifier refusals, never to 429, 529 or 5xx.

Files API

  • PDF and text/plain go in document blocks, images in image blocks, datasets for code execution in container_upload.
  • Convert .docx and .xlsx to text (or PDF) for reading.
  • Files are scoped to a workspace. Deleted, expired or inaccessible files make requests fail.
  • Uploaded files cannot be downloaded; only files created by skills or code execution can.
  • PDFs must not be encrypted; dense ones can overflow context before the page limit.

Traps

  • Treating HTTP 200 or a closed connection as proof that a stream completed.
  • Retrying every 429: the tier spend cap has no retry-after and keeps failing.
  • Retrying 400 or 413 unchanged.
  • Expecting a larger max_tokens to affect output rate limits; it does not count toward OTPM.
  • Parsing each partial_json fragment on its own.
  • Relabeling a binary file as text/plain.
  • Monitoring only error rates, which never shows refusals.

Decide quickly

SituationChoiceWhy
Long generation times out without a responseStream and accumulate, or use BatchesIdle connections get dropped
429 with retry-afterWait that long, then retryEarlier attempts may fail
429 with enforced_spend_limit_reachedStop and alertAccess is paused
529 persists after retriesApplication-level failover or deferRefusal fallback does not cover it
pause_turnResend with assistant content appendedThe server loop is unfinished
Unparseable streamed tool inputtool_result with is_error: trueClaude can correct the call
Large or reused PDFUpload and reference file_idSmaller requests

Sources