Repository navigation
Description
Bug Description
I went through the unit tests looking for ones that only cover the happy path, and added tests for the failure and edge cases they were missing. About 70 of those new tests exposed real bugs in the source. This issue collects them in one place. Each bug has its own collapsible section with the test that finds it and the case it checks. The sections are in the comments below, one comment per area.
The tests are on the branch worktree-test-edge-cases, commit f2fcf6e. I have not fixed any source code. Every bug is pinned by a test marked xfail(strict=True), so the suite stays green today and the test fails loudly once the bug is fixed (remove the marker in the same PR).
There are 78 xfail test functions, 88 test cases once parametrized, covering roughly 70 distinct bugs (a few tests pin the same bug, for example the CRLF rewrite in both the file editor and apply_patch). I ran all 88 with --runxfail and they all fail. I looked at the failure reason for each, but I have not reproduced each bug end to end outside the tests, and I have not triaged severity beyond the short list below.
| Comment | Area | Tests |
|---|---|---|
| 1 | SDK core: agent, conversation, event, critic, context, hooks | 8 |
| 2 | SDK: llm, tool, mcp, security | 7 |
| 3 | SDK: io, git, skills, plugins, profiles, utils | 27 |
| 4 | Agent server | 9 |
| 5 | Tools: file editor, grep, glob, apply_patch | 17 |
| 6 | Workspaces | 10 |
Where I would start
- Secret masking leaks the tail of a longer secret when a shorter secret is a prefix of it (
mask_secrets_in_output). A secretabcnext toabc123turnsabc123into<secret-hidden>123. get_changes_in_repofails for the whole repo as soon as one changed path contains a space.- One MCP tool whose schema uses the tuple form of
itemsmakesto_openai_tool()raise, which breaks the agent step. - The file editor merges an insert into the last line when the file has no trailing newline, and replaces a symlink with a regular file when editing through it.
DockerWorkspaceandApptainerWorkspaceleave the container or server process running when the startup health check fails.- Apptainer sends
SESSION_API_KEYwhile the server prefersOH_SESSION_API_KEYS_0. - The grep tool's own documented example (
*.{ts,tsx}) matches nothing.
Steps to reproduce
git fetch origin worktree-test-edge-cases
git checkout worktree-test-edge-cases
uv sync --frozen --all-extras
uv run pytest <test file> -k <test name> --runxfail
Each section below gives the exact command.
Expected Behavior
The failure and edge cases behave sensibly: no crash, no data loss, no leaked secrets, no orphaned processes.
Environment
Checked on macOS (Darwin), Python 3.13.11, HEAD at c048a1eb8 of main plus the test-only commit above. A few tests (the terminal-session heredoc tests, TestCloneReposIntegration, two plugin_fetch integration tests) already fail on a clean checkout on my machine; those are unrelated and I did not touch them.
Progress
One box per pinned test. A box is ticked when the fix is merged to main and the test's xfail marker is gone. PRs fixing one item should say Part of #6348 (not Fixes #6348), so this tracker stays open.
SDK core: agent, conversation, event, critic, context, hooks
- for
Annotated[X, ...] | Nonethe union args are not unwrapped, so the expected origin is Annotated and neither repair… (test_optional_annotated_fields_are_repaired) → fix(sdk): repair malformed arguments for optional Annotated fields #6613 - _count_events_on_disk counts every event-*.json, but the scan only indexes names matching EVENT_NAME_RE, so a stray… (
test_stray_event_named_file_does_not_corrupt_a_legacy_log) → fix(sdk): ignore stray files when counting persisted events #6349 - max_length < 3 makes title[: max_length - 3] a negative slice, so the 'truncated' title is longer than max_length (
test_fallback_title_never_exceeds_tiny_max_length) → fix(sdk): keep truncated titles within a max_length below 3 #6583 - mask_secrets_in_output replaces values in insertion order, so a shorter secret that prefixes a longer one leaves the… (
test_mask_secrets_in_output_masks_the_longest_overlapping_value) → fix(sdk): mask the longest overlapping secret value first #6356 - _softmax_normalize calls math.exp on raw logits without subtracting the max, so a large logit raises OverflowError (
test_large_sentiment_logits_do_not_overflow) → fix(sdk): normalize large sentiment logits without overflowing #6384 - a non-dict "hooks" wrapper hits data.items() in the before validator and raises AttributeError instead of… (
test_malformed_legacy_wrapper_raises_validation_error) → fix(sdk): report a malformed hooks wrapper as a validation error #6535 - a JSON null reason is stringified to "None" instead of being treated as no reason (
test_null_reason_is_not_stringified) → fix(sdk): treat a JSON null hook reason as no reason #6580 - a timed-out sync hook only kills the shell; its child processes keep running (the async path kills the process group) (
test_timed_out_hook_does_not_leave_its_child_running) → fix(sdk): kill a timed-out sync hook's whole process group #6614
- non-fncall parser .strip()s parameter values, dropping the leading indentation and trailing newline of multiline strings (
test_roundtrip_preserves_multiline_param_whitespace) → fix(llm): preserve whitespace in multiline non-fncall parameter values #6451 - Metrics.diff selects new costs by timestamp > last baseline timestamp, so a cost recorded in the same clock tick (or… (
test_metrics_diff_keeps_cost_recorded_at_baseline_timestamp) → fix(sdk): slice diffed costs by position so a timestamp tie keeps them #6484 - LLMRegistry.remove() keeps the metrics id in _metrics_ids, so re-adding the same LLM is treated as shared and its… (
test_llm_registry_readd_after_remove_keeps_metrics) → fix(sdk): forget a removed LLM's metrics id #6581 - Schema.from_mcp_schema passes MCP argument names straight to pydantic.create_model, so '_'-prefixed names raise… (
test_mcp_action_from_arguments_accepts_underscore_prefixed_argument) → fix(sdk): accept underscore-prefixed MCP argument names #6381 - history_limit=0 slices events[-0:], which sends the whole history instead of none (
test_security_risk_history_limit_zero_sends_no_history) → fix(sdk): treat a zero history limit as no history #6375 - _process_schema_node calls .get() on array 'items', so the valid draft-07 tuple form (items: [...]) raises… (
test_tuple_form_items_does_not_raise) → fix(sdk): accept the draft-07 tuple form of array items #6373 - _process_schema_node only recurses when type == 'object'/'array', so a nullable type list drops nested properties… (
test_nullable_type_list_keeps_nested_structure) → fix(sdk): keep nested structure for nullable type lists #6386
SDK: io, git, skills, plugins, profiles, utils
- is_git_url does not recognise the ssh:// scheme, so a standard ssh:// clone URL is rejected as unparseable (
test_parse_ssh_scheme_url) → fix(sdk): parse git URLs consistently across schemes and suffixes #6379 - the github: shorthand appends .git unconditionally, so 'github:owner/repo.git' becomes '.../repo.git.git' (
test_parse_github_shorthand_with_git_suffix) → fix(sdk): parse git URLs consistently across schemes and suffixes #6379 - normalize_git_url checks the .git suffix before stripping a trailing slash, so 'repo.git/' becomes 'repo.git.git' (
test_parse_https_url_with_git_suffix_and_trailing_slash) → fix(sdk): parse git URLs consistently across schemes and suffixes #6379 - _parse_name_status splits on any whitespace, so a path containing a space raises GitCommandError (
test_get_changes_in_repo_path_with_space) → fix(git): keep file names verbatim in git changes and commit changes #5782 - git's core.quotePath output is not unquoted, so a non-ASCII path comes back as '"caf\303\251.txt"' (
test_get_changes_in_repo_non_ascii_path) → fix(git): keep file names verbatim in git changes and commit changes #5782 - a type change ('T', e.g. file -> symlink) is an unknown status and aborts the whole change listing (
test_get_changes_in_repo_type_change_does_not_abort_listing) → fix(sdk): list a git type change as an updated file #6591 - _show_file_at_rev reads blobs with run_git_command's default strip=True, dropping the first line's indentation (
test_get_commit_file_diff_preserves_edge_whitespace) → fix(sdk): keep the first line's indentation in commit file diffs #6538 - _parse_name_status splits on any whitespace, so a commit touching a path with a space raises GitCommandError (
test_get_commit_changes_path_with_space) → fix(git): keep file names verbatim in git changes and commit changes #5782 - MemoryLRUCache skips an oversize value without evicting the key's previous value, so LocalFileStore.read returns stale… (
test_oversize_overwrite_does_not_serve_stale_cache) → fix(sdk): drop a stale cache entry when the new value is too large to cache #6483 - LocalFileStore.write(bytes) leaves the previous str cached, so a later read returns the old content (
test_bytes_overwrite_does_not_serve_stale_cache) → fix(sdk): drop cached text when a binary write replaces it #6534 - InMemoryFileStore.delete matches by string prefix, so deleting 'a/b' also deletes the sibling 'a/bc' (
test_delete_does_not_remove_siblings_sharing_a_prefix) → fix(sdk): match in-memory store paths at a separator, not a raw prefix #6374 - InMemoryFileStore.list matches by string prefix, so listing 'a' reports a phantom 'a/b/' directory for the file 'ab/c' (
test_list_does_not_include_siblings_sharing_a_prefix) → fix(sdk): match in-memory store paths at a separator, not a raw prefix #6374 - a value larger than max_memory is silently not stored and the previous value is kept, so read returns stale content (
test_oversize_write_is_not_silently_dropped) → fix(sdk): keep an oversize write in the in-memory file store #6635 - file:// URLs are sliced instead of parsed, so the 'localhost' authority becomes a relative path component (
test_resolve_file_url_with_localhost_authority) → fix(sdk): parse file:// URLs instead of slicing the scheme off #6482 - file:// URLs are sliced instead of parsed, so percent-escapes such as %20 are not decoded (
test_resolve_file_url_decodes_percent_escapes) → fix(sdk): parse file:// URLs instead of slicing the scheme off #6482 - list_summaries catches OSError/JSONDecodeError but not UnicodeDecodeError, so one non-UTF-8 file breaks every listing (
test_list_summaries_skips_undecodable_file) → fix(sdk): skip profile files that are not valid UTF-8 #6536 - set_llm_profile_ref does not treat UnicodeDecodeError as a corrupt profile, so a ref cascade aborts instead of skipping… (
test_set_llm_profile_ref_skips_undecodable_file) → fix(sdk): skip profile files that are not valid UTF-8 #6536 - on case-insensitive filesystems rename sees the source file as the existing target, so a case-only rename raises… (
test_rename_case_only_change) → fix(sdk): allow a case-only agent profile rename #6598 - the top-level third-party loop in load_project_skills does not catch UnicodeDecodeError (the nested loop does), so one… (
test_load_project_skills_non_utf8_agents_md_does_not_abort) → fix(sdk): skip an undecodable top-level AGENTS.md instead of aborting #6589 - load_mcp_config catches JSONDecodeError and OSError but not UnicodeDecodeError, so a non-UTF-8 .mcp.json escapes as a… (
test_mcp_json_non_utf8_raises_skill_validation_error) → fix(sdk): report a non-UTF-8 .mcp.json as a skill validation error #6430 - recursive find_regular_md_files compares the README name case-sensitively (flat mode does not), so readme.md loads as a… (
test_find_regular_md_files_recursive_skips_readme_any_case) → fix(sdk): skip a README of any case in recursive skill discovery #6588 - Skill.load reads with encoding='utf-8' (not 'utf-8-sig'), so a BOM hides the frontmatter and a triggered skill becomes… (
test_skill_load_utf8_bom_frontmatter) → fix(sdk): preserve frontmatter in BOM-prefixed skills #6513 - AgentDefinition.load wraps fm.get() in str(), so an empty YAML value becomes the literal string 'None' (model 'None' is… (
test_load_empty_frontmatter_values_fall_back_to_defaults) → fix(sdk): read subagent frontmatter through a BOM and empty values #6590 - _extract_max_iteration_per_run accepts YAML booleans as ints (max_budget_per_run rejects them), so 'yes' silently caps… (
test_load_boolean_max_iteration_per_run_is_not_one) → fix(sdk): ignore a boolean max_iteration_per_run instead of reading it as 1 #6428 - AgentDefinition.load reads with encoding='utf-8' (not 'utf-8-sig'), so a BOM hides the frontmatter and it leaks into… (
test_load_utf8_bom_frontmatter) → fix(sdk): read subagent frontmatter through a BOM and empty values #6590 - redact_url_credentials matches the scheme case-sensitively (the _in_text variant is IGNORECASE), so HTTPS://… (
test_redact_url_credentials_uppercase_scheme) → fix(sdk): match the URL scheme case-insensitively when redacting credentials #6380 - _save_full_content only guards write_text; a save_dir that cannot be created (e.g. an existing file) raises from… (
test_maybe_truncate_unusable_save_dir_falls_back_to_plain_notice) → fix(sdk): fall back when the output directory cannot be created #6220, fix(sdk): fall back when the output directory cannot be created #6634
- _read_execution_status_sync only suppresses OSError/ValueError; a non-object payload raises AttributeError and fails… (
test_status_index_keeps_cached_status_for_corrupt_state) → fix(agent-server): ignore a non-object base_state.json in the status index #6592 - merge() indexes past the end of a copy of the shorter list (
test_merge_appends_items_when_second_list_is_longer) → fix(agent-server): append env list items past the file list length #6387 - merge() raises IndexError when env lists more items than the file (
test_config_env_list_longer_than_file_list_overrides_it) → fix(agent-server): append env list items past the file list length #6387 - X-Archive-Base-Ref echoes base_ref raw instead of through _header_safe, so a non-latin-1 ref 500s and leaks the scratch… (
test_archive_non_latin1_base_ref_is_percent_encoded) → fix(agent-server): percent-encode the X-Archive-Base-Ref header #6585 - an empty path becomes Path('.') and answers for the agent-server process's own working directory instead of erroring (
test_git_empty_path_is_rejected) → fix(agent-server): reject an empty path on the git endpoints #6616 - PubSub.close gathers without return_exceptions, so one failing close raises and skips clearing the subscribers (
test_real_pubsub_close_survives_a_failing_subscriber_close) → fix(agent-server): stop lost to a queued re-arm; event-socket replay races #6577 (test: test(agent-server): cover PubSub.close with a failing subscriber close #6584) - safe_rmtree on a symlinked dir chmods the link target to write-only and returns True while the link remains (
test_safe_rmtree_leaves_a_symlink_target_untouched) → fix(agent-server): make safe_rmtree report what it could not remove #6597 - safe_rmtree's onerror handler swallows failures, so it returns True while a read-only subdirectory keeps the tree on… (
test_safe_rmtree_result_matches_whether_tree_is_gone) → fix(agent-server): make safe_rmtree report what it could not remove #6597 - safe_rmtree on a regular file returns True, leaves the file, and chmods it to write-only (
test_safe_rmtree_on_a_file_reports_failure_or_removes_it) → fix(agent-server): make safe_rmtree report what it could not remove #6597
Tools: file editor, grep, glob, apply_patch
- Update of a missing file is reported as 'Delete File Error' (
test_update_missing_file_error_names_update) → fix(tools): name the patch action that references a missing file #6371 - non-UTF-8 file raises UnicodeDecodeError out of the executor (
test_update_non_utf8_file_returns_error_observation) → fix(tools): surface unreadable patch targets as tool errors #6372 - updating a directory raises IsADirectoryError out of the executor (
test_update_directory_returns_error_observation) → fix(tools): surface unreadable patch targets as tool errors #6372 - a rejected later path leaves earlier files written (non-atomic) (
test_rejected_patch_does_not_apply_earlier_files) → fix(tools): apply a patch all-or-nothing and keep CRLF line endings #6617 - updating a CRLF file rewrites every line ending as LF (
test_update_preserves_crlf_line_endings) → fix(tools): apply a patch all-or-nothing and keep CRLF line endings #6617 - str_replace uniqueness check misses overlapping occurrences (
test_str_replace_rejects_overlapping_occurrences) → fix(tools): refuse str_replace when old_str matches at overlapping offsets #6429 - edits rewrite CRLF line endings as LF for the whole file (
test_str_replace_preserves_crlf_line_endings) → fix(tools): keep CRLF line endings when the file editor writes a file #6618 - atomic write replaces a symlink with a regular file (
test_str_replace_through_symlink_edits_target) → fix(tools): edit a symlink's target instead of replacing the link #6358 - unreadable file raises PermissionError instead of a tool error (
test_view_unreadable_file_returns_error_observation) → fix(tools): report an unreadable file as a file editor error #6596 - insert after a last line with no trailing newline merges lines (
test_insert_after_last_line_without_trailing_newline) → fix(tools): terminate an unterminated last line before inserting after it #6357 - Python glob fallback has no brace expansion, so '*.{json,yaml}' matches nothing (
test_brace_pattern_from_tool_description) → fix(tools): expand brace patterns in the glob Python fallback #6615 - ripgrep backend reports truncated=True when exactly 100 files match (
test_exactly_max_matches_is_not_truncated) → fix(tools): don't report exactly 100 glob matches as truncated #6342 - brace include like '*.{ts,tsx}' is filtered with fnmatch, which has no brace expansion (
test_brace_include_pattern_from_tool_description) → fix(tools): honor brace globs and path patterns in grep include #6325, fix(tools): expand brace globs in the grep include filter #6636 - ripgrep backend passes a leading-dash pattern as a CLI flag (
test_pattern_starting_with_dash) → fix(tools): pass the ripgrep pattern with -e so it cannot be read as a flag #6537 - ripgrep backend treats '--files' pattern as a flag and lists every file (
test_ripgrep_pattern_cannot_inject_flags) → fix(tools): pass the ripgrep pattern with -e so it cannot be read as a flag #6537 - ripgrep regex errors (exit 2) are reported as 'No files found' (
test_ripgrep_unsupported_regex_is_not_silently_empty) → fix(tools): fall back to Python search when ripgrep fails #6593 - system grep backend runs basic regex (no -E), so '|' alternation is literal (
test_alternation_pattern) → fix(grep): use extended regular expressions in the system fallback #4984
- a JSON null pod_status raises AttributeError instead of being retried like other unknown statuses (
test_null_pod_status_is_retried) → fix(workspace): retry a null pod_status like any unknown status #6586 - ApptainerWorkspace leaves the
apptainer runprocess running when the health check fails during construction (test_failed_health_check_terminates_server_process) → fix(workspace): stop the container when Docker/Apptainer startup fails #6499 - with detach_logs=False the server's stdout PIPE is never read, so it blocks once ~64 KiB of logs fill the pipe buffer (
test_undrained_logs_do_not_block_server) → fix(workspace): don't pipe Apptainer server output nobody reads #6619 - ApptainerWorkspace ignores the forwarded OH_SESSION_API_KEYS_0, which the agent server prefers (
test_client_key_matches_key_server_accepts) - ApptainerWorkspace.exit skips RemoteWorkspace.exit, so the AUTOMATION_CALLBACK_URL completion callback is never… (
test_exit_sends_completion_callback) → fix(workspace): send the completion callback from Docker and Apptainer exit #6594 - _get_secret_value nests a 3-attempt retry around the 3-attempt _send_settings_request, so a persistent 5xx makes 9… (
test_get_secret_value_retries_at_most_three_times) → fix(workspace): stop retrying cloud secret fetches twice #6595 - DockerWorkspace leaves the container running when startup fails after
docker run(no cleanup in model_post_init) (test_failed_health_check_stops_container) → fix(workspace): stop the container when Docker/Apptainer startup fails #6499 - an exhausted port range (find_available_tcp_port() == -1) raises OverflowError from socket.bind instead of a clear… (
test_no_free_port_raises_runtime_error) → fix(workspace): report an out-of-range port as not available #6587 - DockerWorkspace.exit skips RemoteWorkspace.exit, so the AUTOMATION_CALLBACK_URL completion callback is never… (
test_exit_sends_completion_callback) → fix(workspace): send the completion callback from Docker and Apptainer exit #6594 - cleanup() run on the log-streaming thread (as del does when that thread drops the last reference) raises 'cannot… (
test_cleanup_from_log_thread_still_stops_container) → fix(workspace): stop the container when cleanup runs on the logs thread #6599
OpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
The author (a repo member) added 78 strict-xfail edge-case tests on branch worktree-test-edge-cases (commit f2fcf6e), all currently failing under --runxfail, and verified the branch touches only test files. Spot checks confirmed two reported bugs directly in main source: SecretRegistry.mask_secrets_in_output (openhands-sdk/openhands/sdk/conversation/secret_registry.py) replaces values in insertion order, so a shorter secret that prefixes a longer one leaves the longer value's tail unmasked, and the grep tool description advertises *.{ts,tsx} include patterns that the fnmatch-based filtering never matches. The issue is internally consistent with the branch, so it is treated as a collector of verified, test-pinned defects.
Scope: fixing the pinned defects in the packages this repo owns (openhands-sdk, openhands-tools, openhands-workspace, openhands-agent-server), including removing each test's xfail(strict=True) marker in the same change that fixes the bug it pins. This is a bug-batch tracker, not a single fix; acceptance below applies per defect. Non-goals: refactors beyond what each fix needs; new features or API changes; fixing the pre-existing failures the author already excluded (terminal-session heredoc tests, TestCloneReposIntegration, the two plugin_fetch integration tests); changing public REST/WebSocket contracts or persisted settings shapes; severity triage or end-to-end production reproduction of each defect beyond what the pinned tests cover.
Acceptance Criteria
- All tests the author marked
xfail(strict=True)on branchworktree-test-edge-casesthat are claimed as fixed by a change either have their xfail marker removed and pass on the change's head, or remain xfail with the author's consent recorded in the PR. - A reviewer can trace each fixed defect to its pinned test via the per-comment sections on this issue, and every test whose marker was removed runs green under the repository's standard test workflow (
uv run pytest) on the change's head. - The two defects verified against
mainsource are fixed with observable before/after evidence: maskingabc123in a registry holdingabcandabc123yieldsleak: <secret-hidden>with no cleartext tail, andGrepAction(pattern="needle", include="*.{ts,tsx}")returns only.tsand.tsxmatches on a directory containing.ts,.tsx, and.pyfiles. - Fixes that touch startup/teardown paths (DockerWorkspace, ApptainerWorkspace container and process cleanup, log-pipe draining,
safe_rmtree, PubSub close) satisfy the repository's conversation-and-resource-lifecycle review checkpoint, including rollback on failed startup and no orphaned containers or child processes. - Fixes that touch secrets or redaction (
mask_secrets_in_output,redact_url_credentials) follow the repository's secret-handling policy and leave no secret fragment in output, logs, or serialized state. - Fixes that change observable behavior of public Python APIs, tool defaults, or persisted events stay within the repository's compatibility policy and, where required by
.agents/skills/custom-codereview-guide.md, include live before/after evidence for runtime-lifecycle bugs rather than mocked-test evidence alone. - Fixes that change tool descriptions, prompt templates, or agent decision logic add the
integration-testlabel per repository guidance, or document why the change cannot affect agent behavior. - The test suite on
mainplus the change keeps the suite green: no pinned xfail test becomes XPASS(strict), and the pre-existing unrelated failures listed in the issue are neither introduced nor fixed silently in these PRs.
Activity
VascoSch92 commentedon Oct 30, 2026
SDK core: agent, conversation, event, critic, context, hooks
for `Annotated[X, ...] | None` the union args are not unwrapped, so the expected origin is Annotated and...
for
Annotated[X, ...] | Nonethe union args are not unwrapped, so the expected origin is Annotated and neither repair appliesTest:
tests/sdk/agent/test_fix_malformed_tool_arguments.py::test_optional_annotated_fields_are_repairedThe case it checks:
_count_events_on_disk counts every event-*.json, but the scan only indexes names matching EVENT_NAME_RE,...
_count_events_on_disk counts every event-*.json, but the scan only indexes names matching EVENT_NAME_RE, so a stray file inflates len() past the mapped indices and iteration raises KeyError
Test:
tests/sdk/conversation/test_event_store.py::test_stray_event_named_file_does_not_corrupt_a_legacy_logThe case it checks:
max_length < 3 makes title[: max_length - 3] a negative slice, so the 'truncated' title is longer than...
max_length < 3 makes title[: max_length - 3] a negative slice, so the 'truncated' title is longer than max_length
Test:
tests/sdk/conversation/test_generate_title.py::test_fallback_title_never_exceeds_tiny_max_lengthThe case it checks:
mask_secrets_in_output replaces values in insertion order, so a shorter secret that prefixes a longer one...
mask_secrets_in_output replaces values in insertion order, so a shorter secret that prefixes a longer one leaves the longer one's tail in cleartext
Test:
tests/sdk/conversation/test_secrets_manager.py::test_mask_secrets_in_output_masks_the_longest_overlapping_valueThe case it checks:
_softmax_normalize calls math.exp on raw logits without subtracting the max, so a large logit raises...
_softmax_normalize calls math.exp on raw logits without subtracting the max, so a large logit raises OverflowError
Test:
tests/sdk/critic/api/test_taxonomy.py::test_large_sentiment_logits_do_not_overflowThe case it checks:
a non-dict "hooks" wrapper hits data.items() in the before validator and raises AttributeError instead of...
a non-dict "hooks" wrapper hits data.items() in the before validator and raises AttributeError instead of ValidationError
Test:
tests/sdk/hooks/test_config.py::test_malformed_legacy_wrapper_raises_validation_errorThe case it checks:
a JSON null reason is stringified to "None" instead of being treated as no reason
Test:
tests/sdk/hooks/test_executor.py::test_null_reason_is_not_stringifiedThe case it checks:
a timed-out sync hook only kills the shell; its child processes keep running (the async path kills the...
a timed-out sync hook only kills the shell; its child processes keep running (the async path kills the process group)
Test:
tests/sdk/hooks/test_executor.py::test_timed_out_hook_does_not_leave_its_child_runningThe case it checks:
VascoSch92 commentedon Oct 30, 2026
SDK: llm, tool, mcp, security
non-fncall parser .strip()s parameter values, dropping the leading indentation and trailing newline of...
non-fncall parser .strip()s parameter values, dropping the leading indentation and trailing newline of multiline strings
Test:
tests/sdk/llm/test_llm_fncall_converter.py::test_roundtrip_preserves_multiline_param_whitespaceThe case it checks:
Metrics.diff selects new costs by timestamp > last baseline timestamp, so a cost recorded in the same...
Metrics.diff selects new costs by timestamp > last baseline timestamp, so a cost recorded in the same clock tick (or after a backwards clock step) is dropped while accumulated_cost still counts it
Test:
tests/sdk/llm/test_llm_metrics.py::test_metrics_diff_keeps_cost_recorded_at_baseline_timestampThe case it checks:
LLMRegistry.remove() keeps the metrics id in _metrics_ids, so re-adding the same LLM is treated as shared...
LLMRegistry.remove() keeps the metrics id in _metrics_ids, so re-adding the same LLM is treated as shared and its metrics are reset
Test:
tests/sdk/llm/test_llm_registry.py::test_llm_registry_readd_after_remove_keeps_metricsThe case it checks:
Schema.from_mcp_schema passes MCP argument names straight to pydantic.create_model, so '_'-prefixed names...
Schema.from_mcp_schema passes MCP argument names straight to pydantic.create_model, so '_'-prefixed names raise NameError, which Agent._get_action_event does not catch
Test:
tests/sdk/mcp/test_mcp_tool_validation.py::test_mcp_action_from_arguments_accepts_underscore_prefixed_argumentThe case it checks:
history_limit=0 slices events[-0:], which sends the whole history instead of none
Test:
tests/sdk/security/grayswan/test_grayswan_analyzer.py::test_security_risk_history_limit_zero_sends_no_historyThe case it checks:
_process_schema_node calls .get() on array 'items', so the valid draft-07 tuple form (items: [...]) raises...
_process_schema_node calls .get() on array 'items', so the valid draft-07 tuple form (items: [...]) raises AttributeError
Test:
tests/sdk/tool/test_mcp_schema.py::test_tuple_form_items_does_not_raiseThe case it checks:
_process_schema_node only recurses when type == 'object'/'array', so a nullable type list drops nested...
_process_schema_node only recurses when type == 'object'/'array', so a nullable type list drops nested properties, required and items
Test:
tests/sdk/tool/test_mcp_schema.py::test_nullable_type_list_keeps_nested_structureThe case it checks:
VascoSch92 commentedon Oct 30, 2026
SDK: io, git, skills, plugins, profiles, utils
is_git_url does not recognise the ssh:// scheme, so a standard ssh:// clone URL is rejected as unparseable
Test:
tests/sdk/extensions/test_fetch.py::test_parse_ssh_scheme_urlThe case it checks:
the github: shorthand appends .git unconditionally, so 'github:owner/repo.git' becomes '.../repo.git.git'
Test:
tests/sdk/extensions/test_fetch.py::test_parse_github_shorthand_with_git_suffixThe case it checks:
normalize_git_url checks the .git suffix before stripping a trailing slash, so 'repo.git/' becomes...
normalize_git_url checks the .git suffix before stripping a trailing slash, so 'repo.git/' becomes 'repo.git.git'
Test:
tests/sdk/extensions/test_fetch.py::test_parse_https_url_with_git_suffix_and_trailing_slashThe case it checks:
_parse_name_status splits on any whitespace, so a path containing a space raises GitCommandError
Test:
tests/sdk/git/test_git_changes.py::test_get_changes_in_repo_path_with_spaceThe case it checks:
git's core.quotePath output is not unquoted, so a non-ASCII path comes back as '"caf\303\251.txt"'
Test:
tests/sdk/git/test_git_changes.py::test_get_changes_in_repo_non_ascii_pathThe case it checks:
a type change ('T', e.g. file -> symlink) is an unknown status and aborts the whole change listing
Test:
tests/sdk/git/test_git_changes.py::test_get_changes_in_repo_type_change_does_not_abort_listingThe case it checks:
_show_file_at_rev reads blobs with run_git_command's default strip=True, dropping the first line's indentation
Test:
tests/sdk/git/test_git_commits.py::test_get_commit_file_diff_preserves_edge_whitespaceThe case it checks:
_parse_name_status splits on any whitespace, so a commit touching a path with a space raises GitCommandError
Test:
tests/sdk/git/test_git_commits.py::test_get_commit_changes_path_with_spaceThe case it checks:
MemoryLRUCache skips an oversize value without evicting the key's previous value, so LocalFileStore.read...
MemoryLRUCache skips an oversize value without evicting the key's previous value, so LocalFileStore.read returns stale content
Test:
tests/sdk/io/test_filestore_cache.py::test_oversize_overwrite_does_not_serve_stale_cacheThe case it checks:
LocalFileStore.write(bytes) leaves the previous str cached, so a later read returns the old content
Test:
tests/sdk/io/test_filestore_cache.py::test_bytes_overwrite_does_not_serve_stale_cacheThe case it checks:
InMemoryFileStore.delete matches by string prefix, so deleting 'a/b' also deletes the sibling 'a/bc'
Test:
tests/sdk/io/test_memory_filestore.py::test_delete_does_not_remove_siblings_sharing_a_prefixThe case it checks:
InMemoryFileStore.list matches by string prefix, so listing 'a' reports a phantom 'a/b/' directory for the...
InMemoryFileStore.list matches by string prefix, so listing 'a' reports a phantom 'a/b/' directory for the file 'ab/c'
Test:
tests/sdk/io/test_memory_filestore.py::test_list_does_not_include_siblings_sharing_a_prefixThe case it checks:
a value larger than max_memory is silently not stored and the previous value is kept, so read returns...
a value larger than max_memory is silently not stored and the previous value is kept, so read returns stale content
Test:
tests/sdk/io/test_memory_filestore.py::test_oversize_write_is_not_silently_droppedThe case it checks:
file:// URLs are sliced instead of parsed, so the 'localhost' authority becomes a relative path component
Test:
tests/sdk/plugin/test_source.py::test_resolve_file_url_with_localhost_authorityThe case it checks:
file:// URLs are sliced instead of parsed, so percent-escapes such as %20 are not decoded
Test:
tests/sdk/plugin/test_source.py::test_resolve_file_url_decodes_percent_escapesThe case it checks:
list_summaries catches OSError/JSONDecodeError but not UnicodeDecodeError, so one non-UTF-8 file breaks...
list_summaries catches OSError/JSONDecodeError but not UnicodeDecodeError, so one non-UTF-8 file breaks every listing
Test:
tests/sdk/profiles/test_agent_profile_store.py::test_list_summaries_skips_undecodable_fileThe case it checks:
set_llm_profile_ref does not treat UnicodeDecodeError as a corrupt profile, so a ref cascade aborts...
set_llm_profile_ref does not treat UnicodeDecodeError as a corrupt profile, so a ref cascade aborts instead of skipping the file
Test:
tests/sdk/profiles/test_agent_profile_store.py::test_set_llm_profile_ref_skips_undecodable_fileThe case it checks:
on case-insensitive filesystems rename sees the source file as the existing target, so a case-only rename...
on case-insensitive filesystems rename sees the source file as the existing target, so a case-only rename raises FileExistsError
Test:
tests/sdk/profiles/test_agent_profile_store.py::test_rename_case_only_changeThe case it checks:
the top-level third-party loop in load_project_skills does not catch UnicodeDecodeError (the nested loop...
the top-level third-party loop in load_project_skills does not catch UnicodeDecodeError (the nested loop does), so one non-UTF-8 AGENTS.md aborts loading every project skill
Test:
tests/sdk/skills/test_load_project_skills.py::test_load_project_skills_non_utf8_agents_md_does_not_abortThe case it checks:
load_mcp_config catches JSONDecodeError and OSError but not UnicodeDecodeError, so a non-UTF-8 .mcp.json...
load_mcp_config catches JSONDecodeError and OSError but not UnicodeDecodeError, so a non-UTF-8 .mcp.json escapes as a raw error
Test:
tests/sdk/skills/test_mcp_json.py::test_mcp_json_non_utf8_raises_skill_validation_errorThe case it checks:
recursive find_regular_md_files compares the README name case-sensitively (flat mode does not), so...
recursive find_regular_md_files compares the README name case-sensitively (flat mode does not), so readme.md loads as a skill
Test:
tests/sdk/skills/test_skill_utils.py::test_find_regular_md_files_recursive_skips_readme_any_caseThe case it checks:
Skill.load reads with encoding='utf-8' (not 'utf-8-sig'), so a BOM hides the frontmatter and a triggered...
Skill.load reads with encoding='utf-8' (not 'utf-8-sig'), so a BOM hides the frontmatter and a triggered skill becomes always-on
Test:
tests/sdk/skills/test_skill_utils.py::test_skill_load_utf8_bom_frontmatterThe case it checks:
AgentDefinition.load wraps fm.get() in str(), so an empty YAML value becomes the literal string 'None'...
AgentDefinition.load wraps fm.get() in str(), so an empty YAML value becomes the literal string 'None' (model 'None' is then looked up as an LLM profile)
Test:
tests/sdk/subagent/test_subagent_schema.py::test_load_empty_frontmatter_values_fall_back_to_defaultsThe case it checks:
_extract_max_iteration_per_run accepts YAML booleans as ints (max_budget_per_run rejects them), so 'yes'...
_extract_max_iteration_per_run accepts YAML booleans as ints (max_budget_per_run rejects them), so 'yes' silently caps a run at 1
Test:
tests/sdk/subagent/test_subagent_schema.py::test_load_boolean_max_iteration_per_run_is_not_oneThe case it checks:
AgentDefinition.load reads with encoding='utf-8' (not 'utf-8-sig'), so a BOM hides the frontmatter and it...
AgentDefinition.load reads with encoding='utf-8' (not 'utf-8-sig'), so a BOM hides the frontmatter and it leaks into the prompt
Test:
tests/sdk/subagent/test_subagent_schema.py::test_load_utf8_bom_frontmatterThe case it checks:
redact_url_credentials matches the scheme case-sensitively (the _in_text variant is IGNORECASE), so...
redact_url_credentials matches the scheme case-sensitively (the _in_text variant is IGNORECASE), so HTTPS:// credentials leak
Test:
tests/sdk/utils/test_redact.py::test_redact_url_credentials_uppercase_schemeThe case it checks:
_save_full_content only guards write_text; a save_dir that cannot be created (e.g. an existing file)...
_save_full_content only guards write_text; a save_dir that cannot be created (e.g. an existing file) raises from maybe_truncate
Test:
tests/sdk/utils/test_truncate.py::test_maybe_truncate_unusable_save_dir_falls_back_to_plain_noticeThe case it checks:
VascoSch92 commentedon Oct 30, 2026
Agent server
_read_execution_status_sync only suppresses OSError/ValueError; a non-object payload raises AttributeError...
_read_execution_status_sync only suppresses OSError/ValueError; a non-object payload raises AttributeError and fails every status-filtered count
Test:
tests/agent_server/test_conversation_service.py::test_status_index_keeps_cached_status_for_corrupt_stateThe case it checks:
merge() indexes past the end of a copy of the shorter list
Test:
tests/agent_server/test_env_parser.py::test_merge_appends_items_when_second_list_is_longerThe case it checks:
merge() raises IndexError when env lists more items than the file
Test:
tests/agent_server/test_env_parser.py::test_config_env_list_longer_than_file_list_overrides_itThe case it checks:
X-Archive-Base-Ref echoes base_ref raw instead of through _header_safe, so a non-latin-1 ref 500s and...
X-Archive-Base-Ref echoes base_ref raw instead of through _header_safe, so a non-latin-1 ref 500s and leaks the scratch archive
Test:
tests/agent_server/test_file_router.py::test_archive_non_latin1_base_ref_is_percent_encodedThe case it checks:
an empty path becomes Path('.') and answers for the agent-server process's own working directory instead...
an empty path becomes Path('.') and answers for the agent-server process's own working directory instead of erroring
Test:
tests/agent_server/test_git_router.py::test_git_empty_path_is_rejectedThe case it checks:
PubSub.close gathers without return_exceptions, so one failing close raises and skips clearing the subscribers
Test:
tests/agent_server/test_pub_sub.py::test_real_pubsub_close_survives_a_failing_subscriber_closeThe case it checks:
safe_rmtree on a symlinked dir chmods the link target to write-only and returns True while the link remains
Test:
tests/agent_server/test_utils.py::test_safe_rmtree_leaves_a_symlink_target_untouchedThe case it checks:
safe_rmtree's onerror handler swallows failures, so it returns True while a read-only subdirectory keeps...
safe_rmtree's onerror handler swallows failures, so it returns True while a read-only subdirectory keeps the tree on disk
Test:
tests/agent_server/test_utils.py::test_safe_rmtree_result_matches_whether_tree_is_goneThe case it checks:
safe_rmtree on a regular file returns True, leaves the file, and chmods it to write-only
Test:
tests/agent_server/test_utils.py::test_safe_rmtree_on_a_file_reports_failure_or_removes_itThe case it checks:
VascoSch92 commentedon Oct 30, 2026
Tools: file editor, grep, glob, apply_patch
Update of a missing file is reported as 'Delete File Error'
Test:
tests/tools/apply_patch/test_apply_patch_executor.py::test_update_missing_file_error_names_updateThe case it checks:
non-UTF-8 file raises UnicodeDecodeError out of the executor
Test:
tests/tools/apply_patch/test_apply_patch_executor.py::test_update_non_utf8_file_returns_error_observationThe case it checks:
updating a directory raises IsADirectoryError out of the executor
Test:
tests/tools/apply_patch/test_apply_patch_executor.py::test_update_directory_returns_error_observationThe case it checks:
a rejected later path leaves earlier files written (non-atomic)
Test:
tests/tools/apply_patch/test_apply_patch_executor.py::test_rejected_patch_does_not_apply_earlier_filesThe case it checks:
updating a CRLF file rewrites every line ending as LF
Test:
tests/tools/apply_patch/test_apply_patch_executor.py::test_update_preserves_crlf_line_endingsThe case it checks:
str_replace uniqueness check misses overlapping occurrences
Test:
tests/tools/file_editor/test_edge_cases.py::test_str_replace_rejects_overlapping_occurrencesThe case it checks:
edits rewrite CRLF line endings as LF for the whole file
Test:
tests/tools/file_editor/test_edge_cases.py::test_str_replace_preserves_crlf_line_endingsThe case it checks:
atomic write replaces a symlink with a regular file
Test:
tests/tools/file_editor/test_edge_cases.py::test_str_replace_through_symlink_edits_targetThe case it checks:
unreadable file raises PermissionError instead of a tool error
Test:
tests/tools/file_editor/test_edge_cases.py::test_view_unreadable_file_returns_error_observationThe case it checks:
insert after a last line with no trailing newline merges lines
Test:
tests/tools/file_editor/test_edge_cases.py::test_insert_after_last_line_without_trailing_newlineThe case it checks:
Python glob fallback has no brace expansion, so '*.{json,yaml}' matches nothing
Test:
tests/tools/glob/test_glob_edge_cases.py::test_brace_pattern_from_tool_descriptionThe case it checks:
ripgrep backend reports truncated=True when exactly 100 files match
Test:
tests/tools/glob/test_glob_edge_cases.py::test_exactly_max_matches_is_not_truncatedThe case it checks:
brace include like '*.{ts,tsx}' is filtered with fnmatch, which has no brace expansion
Test:
tests/tools/grep/test_grep_edge_cases.py::test_brace_include_pattern_from_tool_descriptionThe case it checks:
ripgrep backend passes a leading-dash pattern as a CLI flag
Test:
tests/tools/grep/test_grep_edge_cases.py::test_pattern_starting_with_dashThe case it checks:
ripgrep backend treats '--files' pattern as a flag and lists every file
Test:
tests/tools/grep/test_grep_edge_cases.py::test_ripgrep_pattern_cannot_inject_flagsThe case it checks:
ripgrep regex errors (exit 2) are reported as 'No files found'
Test:
tests/tools/grep/test_grep_edge_cases.py::test_ripgrep_unsupported_regex_is_not_silently_emptyThe case it checks:
system grep backend runs basic regex (no -E), so '|' alternation is literal
Test:
tests/tools/grep/test_grep_edge_cases.py::test_alternation_patternThe case it checks:
VascoSch92 commentedon Oct 30, 2026
Workspaces
a JSON null pod_status raises AttributeError instead of being retried like other unknown statuses
Test:
tests/workspace/test_api_remote_workspace.py::test_null_pod_status_is_retriedThe case it checks:
ApptainerWorkspace leaves the `apptainer run` process running when the health check fails during construction
Test:
tests/workspace/test_apptainer_workspace.py::test_failed_health_check_terminates_server_processThe case it checks:
with detach_logs=False the server's stdout PIPE is never read, so it blocks once ~64 KiB of logs fill the...
with detach_logs=False the server's stdout PIPE is never read, so it blocks once ~64 KiB of logs fill the pipe buffer
Test:
tests/workspace/test_apptainer_workspace.py::test_undrained_logs_do_not_block_serverThe case it checks:
ApptainerWorkspace ignores the forwarded OH_SESSION_API_KEYS_0, which the agent server prefers BUG:...
ApptainerWorkspace ignores the forwarded OH_SESSION_API_KEYS_0, which the agent server prefers BUG: ApptainerWorkspace sends SESSION_API_KEY although the agent server prefers the forwarded OH_SESSION_API_KEYS_0
Test:
tests/workspace/test_apptainer_workspace.py::test_client_key_matches_key_server_acceptsThe case it checks:
ApptainerWorkspace.__exit__ skips RemoteWorkspace.__exit__, so the AUTOMATION_CALLBACK_URL completion...
ApptainerWorkspace.exit skips RemoteWorkspace.exit, so the AUTOMATION_CALLBACK_URL completion callback is never sent
Test:
tests/workspace/test_apptainer_workspace.py::test_exit_sends_completion_callbackThe case it checks:
_get_secret_value nests a 3-attempt retry around the 3-attempt _send_settings_request, so a persistent 5xx...
_get_secret_value nests a 3-attempt retry around the 3-attempt _send_settings_request, so a persistent 5xx makes 9 requests
Test:
tests/workspace/test_cloud_workspace.py::test_get_secret_value_retries_at_most_three_timesThe case it checks:
DockerWorkspace leaves the container running when startup fails after `docker run` (no cleanup in...
DockerWorkspace leaves the container running when startup fails after
docker run(no cleanup in model_post_init)Test:
tests/workspace/test_docker_workspace.py::test_failed_health_check_stops_containerThe case it checks:
an exhausted port range (find_available_tcp_port() == -1) raises OverflowError from socket.bind instead of...
an exhausted port range (find_available_tcp_port() == -1) raises OverflowError from socket.bind instead of a clear RuntimeError
Test:
tests/workspace/test_docker_workspace.py::test_no_free_port_raises_runtime_errorThe case it checks:
DockerWorkspace.__exit__ skips RemoteWorkspace.__exit__, so the AUTOMATION_CALLBACK_URL completion...
DockerWorkspace.exit skips RemoteWorkspace.exit, so the AUTOMATION_CALLBACK_URL completion callback is never sent
Test:
tests/workspace/test_docker_workspace.py::test_exit_sends_completion_callbackThe case it checks:
cleanup() run on the log-streaming thread (as __del__ does when that thread drops the last reference)...
cleanup() run on the log-streaming thread (as del does when that thread drops the last reference) raises 'cannot join current thread' before
docker stopTest:
tests/workspace/test_docker_workspace.py::test_cleanup_from_log_thread_still_stops_containerThe case it checks:
VascoSch92 commentedon Nov 2, 2026
@yftx293 thanks for picking these up. Six of your PRs (#6379, #6380, #6381, #6384, #6386, #6387) said
Fixes #6348, which would have closed this tracker as soon as the first one merged. I changed them toPart of #6348.For any further PRs against this issue, please write
Part of #6348instead ofFixes,ClosesorResolves, as the Progress section above asks. The tracker should stay open until every item is done.VascoSch92 commentedon Nov 3, 2026
hey @herniqeu
thanks for that.
Can you change the PR description? We do have a template for that? Can you change for every PR?
VascoSch92 commentedon Nov 3, 2026
@yftx293 Can you stop to put Fixes ISSUE_NUMBER in your PR? thanks :-)
test(llm): port the pinned OpenHands#6348 regression for multiline pa…
VascoSch92 commentedon Nov 5, 2026
@yftx293 Could you stop to put fixes ISSUE NUMBER in the description of the PR?
yftx293 commentedon Nov 5, 2026
Sorry about that, and thanks for the nudge — understood now.
I've removed the closing keyword from my open PR descriptions: the
#6348ones sayPart of #6348(with the sub-item quoted), and#6459now saysRelated to #6442instead ofFixes. I won't useFixes/Closesin PR descriptions from here on.