refactor(tools): group H — wrap introduced >100-col lines
This commit is contained in:
@@ -148,7 +148,8 @@ def resolve_provider_secret(
|
||||
return ""
|
||||
except Exception: # pragma: no cover — secret_scope is in-repo
|
||||
pass
|
||||
key = str(env_getter(env_var) or "").strip() if env_getter is not None else _dotenv_value(env_var)
|
||||
key = (str(env_getter(env_var) or "").strip() if env_getter is not None
|
||||
else _dotenv_value(env_var))
|
||||
if key or not provider_id:
|
||||
return key
|
||||
try:
|
||||
|
||||
@@ -47,7 +47,8 @@ def get_tool_output_limits() -> Dict[str, int]:
|
||||
_cached_limits = {
|
||||
"max_bytes": _coerce_positive_int(section.get("max_bytes"), DEFAULT_MAX_BYTES),
|
||||
"max_lines": _coerce_positive_int(section.get("max_lines"), DEFAULT_MAX_LINES),
|
||||
"max_line_length": _coerce_positive_int(section.get("max_line_length"), DEFAULT_MAX_LINE_LENGTH),
|
||||
"max_line_length": _coerce_positive_int(
|
||||
section.get("max_line_length"), DEFAULT_MAX_LINE_LENGTH),
|
||||
}
|
||||
return _cached_limits
|
||||
|
||||
|
||||
@@ -287,5 +287,6 @@ def enforce_turn_budget(
|
||||
if replacement != content:
|
||||
total_size += len(replacement) - size
|
||||
tool_messages[idx]["content"] = replacement
|
||||
logger.info("Budget enforcement: persisted tool result %s (%d chars)", tool_use_id, size)
|
||||
logger.info("Budget enforcement: persisted tool result %s (%d chars)",
|
||||
tool_use_id, size)
|
||||
return tool_messages
|
||||
|
||||
@@ -24,7 +24,8 @@ def _schema_for_local_validation(node: Any) -> Any:
|
||||
return node
|
||||
# Literal keywords hold instance data, not schemas: copy byte-for-byte.
|
||||
normalized = {
|
||||
key: copy.deepcopy(value) if key in _SCHEMA_LITERAL_KEYS else _schema_for_local_validation(value)
|
||||
key: (copy.deepcopy(value) if key in _SCHEMA_LITERAL_KEYS
|
||||
else _schema_for_local_validation(value))
|
||||
for key, value in node.items() if key != "nullable"}
|
||||
if node.get("nullable") is not True:
|
||||
return normalized
|
||||
|
||||
Reference in New Issue
Block a user