refactor(tools): group H — wrap introduced >100-col lines

This commit is contained in:
Teknium
2026-09-02 22:55:05 -07:00
parent 5db38e3a4e
commit 04247b9840
4 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -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:
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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
+2 -1
View File
@@ -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