launchdarkly-ai-opencode-agents
OpenCode handler for launchdarkly-ai-server. async with handler starts opencode serve and waits until it is healthy. The process stops when that context exits. It does not depend on an OpenCode SDK.
provides_for: ['*', 'agent'] — matches an agent-mode variation for any provider.
pip install launchdarkly-ai-server launchdarkly-server-sdk launchdarkly-ai-opencode-agents
import asyncio
import os
from launchdarkly_ai_opencode_agents import create_opencode_handler
from launchdarkly_ai_server import config, init_client, shutdown
async def main() -> None:
await init_client()
handler = create_opencode_handler(
cwd="/work",
config="/home/app/.vega/opencode.json",
env=os.environ.copy(),
)
async with handler:
async for event in config(key="my-agent", handler=handler).stream(
"Hello", {"kind": "user", "key": "user-1"}
):
print(event)
await shutdown()
asyncio.run(main())
cwd is the working directory, config is the OpenCode config file, and env is the child environment. The handler sets OPENCODE_CONFIG from config, replaces any OPENCODE_SERVER_USERNAME in env with opencode, replaces any OPENCODE_SERVER_PASSWORD with a generated secret, and binds opencode serve to loopback. Requests to that server use that username and secret as basic auth. A caller does not pass a URL, an HTTP client, or a transport. command overrides the opencode executable; a test passes a fake executable there.
Entering the handler starts opencode serve and returns once it is healthy. The process stops when the context exits, after config().stream() returns. Put a wall-clock limit around config().stream(), not around the context. A judge routed here runs as a full OpenCode agent: the server's tools, in cwd, apply to the judge prompt. There is no tool-less judge mode. The handler yields AG-UI text and tool events. config().stream() yields chunk then done.
Metadata
Release files for launchdarkly-ai-opencode-agents 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| launchdarkly_ai_opencode_agents-0.2.0.tar.gz | 28.8 kB | Without provenance | Details for launchdarkly_ai_opencode_agents-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| launchdarkly_ai_opencode_agents-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for launchdarkly_ai_opencode_agents-0.2.0-py3-none-any.whl |
Total release size: 47.1 kB
Release files / launchdarkly_ai_opencode_agents-0.2.0.tar.gz
| Download URL | launchdarkly_ai_opencode_agents-0.2.0.tar.gz |
|---|---|
| Size | 28.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9574ddb941aa148191f23fa0ab09b3cc7dfc7b8fc73095e21484d95ef5903ba2
|
|
BLAKE2b-256 checksum How to use checksums |
7a18dcd59740121df6d0a09d6cee28cd3440125e15c454d68de95e36c3f314e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / launchdarkly_ai_opencode_agents-0.2.0-py3-none-any.whl
| Download URL | launchdarkly_ai_opencode_agents-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f91a0df5f92cb643370a7be56f6860d0e8c12dd84e0268f98b982624517865a
|
|
BLAKE2b-256 checksum How to use checksums |
624ad2469d88590af10716f74821d9cebe23d5358acef552c390d683a9641306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for launchdarkly-ai-opencode-agents 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.