an atomdrift project
Hostile 99% python Download

openhands-sdk 1.63.1

Legitimate ML/agent SDKs

Calls glob for filename searchCaptures modification time into a variable

Evidence

imports PackageNotFoundError from importlib.metadata __init__.py · lines 1–48
1from __future__ import annotations
2
3from importlib.metadata import PackageNotFoundError, version
4
5from openhands.sdk.agent import (
6 Agent,
7 AgentBase,
8)
9from openhands.sdk.banner import _print_banner
10from openhands.sdk.context import AgentContext, load_memory
11from openhands.sdk.context.condenser import (
12 LLMSummarizingCondenser,
13)
14from openhands.sdk.conversation import (
15 BaseConversation,
16 Conversation,
17 ConversationCallbackType,
18 ConversationExecutionStatus,
19 LocalConversation,
20 RemoteConversation,
21)
22from openhands.sdk.conversation.conversation_stats import ConversationStats
23from openhands.sdk.event import Event, HookExecutionEvent, LLMConvertibleEvent
24from openhands.sdk.event.llm_convertible import MessageEvent
25from openhands.sdk.io import FileStore, LocalFileStore
26from openhands.sdk.llm import (
27 LLM,
28 LLM_PROFILE_SCHEMA_VERSION,
29 DecisionModel,
30 DecisionResult,
31 FallbackStrategy,
32 ImageContent,
33 LLMProfileStore,
34 LLMRegistry,
35 LLMStreamChunk,
36 Message,
37 RedactedThinkingBlock,
38 RegistryEvent,
39 TextContent,
40 ThinkingBlock,
41 TokenCallbackType,
42 TokenUsage,
43)
44from openhands.sdk.logger import get_logger
45from openhands.sdk.mcp import (
46 MCPClient,
47 MCPToolDefinition,
48 MCPToolObservation,
Claude agent identity reference acp_agent.py · lines 1–7
1"""ACPAgent — an AgentBase subclass that delegates to an ACP server.
2
3The Agent Client Protocol (ACP) lets OpenHands power conversations using
4ACP-compatible servers (Claude Code, Gemini CLI, etc.) instead of direct
5LLM calls. The ACP server manages its own LLM, tools, and execution;
6the ACPAgent relays user messages and collects the response. OpenHands
7can still append prompt-on …
imports MCPOAuthAuthCredential from openhands.sdk.mcp.config acp_agent.py · lines 12–59
12end of each step to delimit that completed turn for downstream consumers.
13
14See https://agentclientprotocol.com/protocol/overview
15"""
16
17from __future__ import annotations
18
19import asyncio
20import atexit
21import contextlib
22import functools
23import inspect
24import json
25import os
26import re
27import shutil
28import threading
29import time
30import uuid
31import weakref
32from collections.abc import (
33 Awaitable,
34 Callable,
35 Collection,
36 Generator,
37 Sequence,
38)
39from concurrent.futures import Future
40from pathlib import Path
41from typing import TYPE_CHECKING, Annotated, Any, Final, Literal, NamedTuple
42
43from acp.client.connection import ClientSideConnection
44from acp.exceptions import RequestError as ACPRequestError
45from acp.meta import AGENT_METHODS
46from acp.schema import (
47 AcpMcpServer,
48 AgentMessageChunk,
49 AgentThoughtChunk,
50 AllowedOutcome,
51 ConnectMcpResponse,
52 CreateElicitationResponse,
53 CreateTerminalResponse,
54 DeclineElicitationResponse,
55 DisconnectMcpResponse,
56 ElicitationMode,
57 EnvVariable,
58 HttpHeader,
59 HttpMcpServer,
Python reads an environment variable acp_agent.py · lines 167–173
167:55… ication handler
168# completes almost immediately. This timeout is a safety net for slow
169# or remote servers.
170_USAGE_UPDATE_TIMEOUT: float = float(os.environ.get("ACP_USAGE_UPDATE_TIMEOUT", "2.0"))
171
172# Retry configuration for transient ACP connection errors.
173# These errors can occur when t …
Python reads AUTH-named environment variable acp_agent.py · lines 177–187
177:33… wait briefly for the ACP prompt task to react
178# to session/cancel before rewiring callbacks for the next turn.
179_ACP_CANCEL_DRAIN_TIMEOUT: float = float(
180 os.environ.get("ACP_CANCEL_DRAIN_TIMEOUT", "2.0")
181)
182
183_ACP_AUTH_TIMEOUT: float = float(os.environ.get("ACP_AUTH_TIMEOUT", "30.0"))
184_ACP_NPX_CACHE_WARM_TIMEOUT: float = float(
185 os.environ.get("ACP_NPX_CACHE_WARM_TIMEOUT", "300")
186)
187_ACP_V …

Showing the top 5 files — 7 more files (98 regions) not shown.

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.