Reference applications¶
These examples ship in the SDK/CLI 0.2.0. Their local paths execute real sandboxed handlers. Remote paths require an upgraded, ready workspace and an active signed package.
Apply an approved record change and recover without a duplicate write¶
This application example changes one synthetic ticket in a real temporary SQLite database. Its cases show rejection leaving the record untouched, approval advancing the version once, and a lost response being reconciled from the committed operation receipt. Repeating the same operation does not write again; a stale record version or changed request under the same operation ID fails.
Approval binds the run, tool, exact arguments, and operation identity. In production, keep the corresponding receipt in your system of record and inspect the actual result before resolving uncertainty. This example uses LocalEmulator for control flow and runs callbacks in your application process. It does not install a write-capable extension or demonstrate a remote Agent approval. Remote decisions use the customer approval APIs described in durable execution.
Approve a real Agent workspace write¶
examples/remote_approved_record.py uses the real SDK and qualified Open Agent. It creates one synthetic JSON record in a disposable task workspace, after an exact human decision. It does not modify an external ticketing service. Use a project configured with Read/Write permission and the write_approval_tasks capability.
python examples/remote_approved_record.py submit --operation-id synthetic-record:review:v1
python examples/remote_approved_record.py approvals
python examples/remote_approved_record.py decide APPROVAL_ID approve
python examples/remote_approved_record.py status TASK_ID
Provide GEYSER_API_URL and a project GEYSER_SERVICE_TOKEN for submission/status. Approval inspection and decisions use GEYSER_DEVELOPER_TOKEN, issued to a current owner/admin with approvals:decide and runs:read. Use reject to exercise refusal. The example verifies the exact Write arguments digest before deciding and never approves a different proposal.
The task has $1, 300-second, five-provider-request and two-tool-call ceilings. Waiting for a human pauses execution; inspect the task/run after deciding. If a response is interrupted, reuse the submission operation ID or inspect the same approval. Repeating the decision command recovers an already recorded matching decision. It does not submit a second write.
The integration regression runs the actual Cell, worker, Open provider loop and filesystem write with a deterministic local model. It checks approval, rejection, interrupted decision acknowledgement and completed-task recovery without another write. Production provider behavior and cost must be measured separately. After trying the example, erase the disposable developer project through the console to remove its owned inputs/results and queued work; revoke its credentials.
Normalize issue intake¶
Input contains issue number, title, body, and labels; output has a stable source_id, trimmed text and a deterministic category. This is a useful adapter between your webhook receiver and a task system. Your application fetches the issue using its own authorized integration and supplies JSON. The handler never contacts GitHub or receives its credentials.
Provide a file with --input issue.json. The frozen cases check correct normalization and invalid issue identity.
Reject unsupported citations before accepting an answer¶
python examples/extension_app.py source-review-gate
geyser test examples/packages/source-review-gate
Supply known source_ids and claims, each with text and source_ids. The evaluator returns passed and zero-based unsupported_claims. It rejects missing or invented references and empty evaluations. It does not assess the truth of cited material.
Install this exact package using the extension workflow, then run the same application remotely:
python examples/extension_app.py source-review-gate --remote-package YOUR_ACTIVE_PACKAGE_ID --operation-id review:document-123:v1
Provide GEYSER_API_URL and GEYSER_SERVICE_TOKEN through your own secret manager. The application uploads owned JSON, submits an idempotent task, polls with a deadline and retrieves the typed result.
Review supplied material with an Agent¶
Create material.json as an array of objects with source_id and text. Select a qualified Open Agent and use a service credential from the console:
The example requests a summary and cited claims with limits of $1, 300 seconds, ten model requests and twenty tool calls. These are example ceilings, not a price quote or an estimate of actual provider cost. The Agent remains subject to workspace policy and human approvals. Inspect the returned run and apply the source-review gate to the output before accepting it.
A schema-valid answer is not necessarily a correct answer. Build application-specific critical cases from your real failure modes, and measure quality against a simpler direct-model or deterministic baseline.
Support escalation investigator¶
examples/support_escalation.py chains both extensions with a qualified Open Agent. It normalizes a supplied ticket, asks the Agent to prepare an evidence-linked diagnosis and draft reply, then checks citation coverage. Each stage has a stable operation ID, so reconnecting with the same inputs resumes the existing tasks. The gate checks that cited source IDs exist; a human still judges whether the diagnosis is true and whether the reply should be sent.
After signing, uploading, and activating both reference packages in your project:
python examples/support_escalation.py \
examples/packages/issue-normalizer/example-input.json examples/support-facts.json \
--operation-id support-synthetic-42-v1 \
--normalizer-package "$NORMALIZER_PACKAGE_ID" --review-package "$REVIEW_PACKAGE_ID"
Use your application's authorized ticket/account API to gather real records before submitting them. These packages do not receive external service credentials or fetch arbitrary URLs. The example produces a draft and never sends a customer message. The investigation has a $1 model-cost ceiling, ten provider requests and a 300-second elapsed limit; the two pure extension stages have 30-second limits and no model calls. Account compute/storage charges can be additional. Inspect the returned run IDs for observed usage and failures.