# Decisions — DalySDK

Reverse chronological. Package-specific decisions only.
Platform-wide decisions live in `/agents/DECISIONS.md`.

## 2026-03-24 — Energy-model submissions are async-only and compatibility flags are no-ops

- `client.energy_models.create()`, `query()`, `run_saved()`, `create_legacy_query()`, `DalyClient.run_energy_model()`, and `LegacyEnergyModel.run()/run_query()` now treat `async_mode` and `run_async` as compatibility-only inputs.
- Submission helpers no longer add special sync-path timeout behavior; they forward explicit request timeouts only.
- Batch orchestration continues to rely on accepted submission envelopes and extracts `taskId` / `task_id` plus `energyModelId` / `energy_model_id` / `runIndex` / `run_index` from the accepted response body.
- Legacy block-query compatibility still preserves `block_results` / `block_results_index` and the full submitted block list.

## 2026-03-18 — Legacy energy-model block selection stays full-model on the wire
Current `/energymodels` compatibility behavior treats deprecated legacy block-query controls as block-results filtering, not single-block execution.

- `create_legacy_query()`, `DalyClient.run_energy_model()`, and `LegacyEnergyModel.run_query()` keep supporting `block_results` / `block_results_index`.
- When `block_results_index` is used, the SDK still emits deprecated `blockQuery` / `blockQueryIndex` fields and `?blockresults=true` for compatibility.
- The SDK no longer trims `blocks` down to a single selected block before submission, because the current API validates `blockIndex` against the full block list and preserves zero-based filtered block keys in the public response.

## 2026-02-16 — Error taxonomy finalized (#16)
Added `ConflictError` (409), `RateLimitError` (429, with `retry_after`), and `TimeoutError` (wraps httpx timeouts). All new exceptions inherit from `DalyAPIError` for uniform catching. Backward compatible -- no existing exceptions were renamed or removed.

## 2026-02-13 — Package decisions standardized for agent continuity
Normalized this file to a concise package-local decision log.

## 2026-02-12 — SDK is a standalone package in packages/sdk
SDK code was extracted from API internals and maintained as an independent publishable package.

## 2026-02-12 — SDK returns parsed dict payloads, not runtime model objects
Client methods return parsed JSON/dict-style payloads to keep runtime dependency surface minimal.

## 2026-02-12 — Internal imports remain absolute within dalysdk namespace
Package internals use absolute `dalysdk.*` imports to avoid cross-package coupling.
