Address BLOCKING issues identified in the PR review by HAL9001:
- Delete pytest tests (tests/lsp/test_stdio_transport.py) — project only
sanctions Behave for unit tests; pytest tests won't run in CI and don't
contribute to coverage. BDD tests in features/ already provide this
coverage.
- Fix BDD step pattern mismatch — the @when decorator had extra spaces
around backticks (' StdioTransport.start() ') vs feature file's clean ''
StdioTransport.start()''. Behave would raise StepNotImplemented.
- Remove redundant second @when handler that was not matched by any scenario.
- Add TDD regression tags (@tdd_issue, @tdd_issue_10597) to both BDD scenarios
as required by CONTRIBUTING.md for bug-fix regression tests.
- Fix lint errors in transport.py: replace try-except-pass with
contextlib.suppress(Exception), remove unused noqa directives, add missing
import.
Closes#10597
When Popen() succeeds but then raises OSError (e.g., exec failure in forked
child), the process reference isn't cleaned up, potentially leaking zombie/orphan
language-server processes.
Fix sets _process = None before Popen() call and calls stop() on any partially-
started process in the OSError handler to prevent leaks. Added BDD + pytest
test coverage for regression guard.
Closes#10597
2026-05-14 22:42:24 +00:00
5 changed files with 262 additions and 151 deletions
test step now filters files by bug tag via `find_tdd_tests` before
checking (matches the production code path); `after_scenario` temp
directory cleanup no longer sets `context.temp_dir = None` (fixes
cleanup conflict with `cli_init_yes_flag_steps.py`); 2 new Behave
scenarios covering multi-line PR description parsing and non-string
`pr_diff` type guard.
- Added Fix-then-Revalidate orchestration loop for required validations:
bounded retry with configurable limits (0--100 per Safety Profile),
strategy revision escalation via `auto_strategy_revision` float
threshold, user escalation via `needs_user_escalation` result flag,
and domain events (`VALIDATION_FIX_ATTEMPTED`, `VALIDATION_FIX_SUCCEEDED`,
`VALIDATION_FIX_EXHAUSTED`). Validation errors are treated as required
failures regardless of mode. Includes `auto_validation_fix` threshold,
per-resource retry tracking, early-exit signalling via `None` return from
`FixCallback`, event bus circuit breaker with lock-protected failure
counter, spec-required `validation_summary` and
`final_validation_results` fields on the result model, DI container
## [Unreleased]
@@ -73,19 +24,15 @@ Changed `wf10_batch.robot` to be less likely to create files, and
- **`agents session tell` invokes real LLM orchestrator actor** (#5784): Replaced the
M3 echo-stub with real actor invocation via `SessionWorkflow`, routing through
`LangChainSessionCaller` → `ToolCallingRuntime.run_tool_loop()`. The user prompt
`LangChainSessionCaller` → `ToolCallingRuntime.run_tool_loop()`. The user prompt
is sent to the session's bound orchestrator actor (or `--actor` override), the
assistant's response is persisted via `SessionService.append_message()`, and token
usage is tracked via `SessionService.update_token_usage()`. Output includes a
usage is tracked via `SessionService.update_token_usage()`. Output includes a
**Usage** panel (Rich/Plain) or `usage` object (JSON/YAML) with input tokens,
output tokens, estimated cost, and duration. The `--stream` flag produces real
LLM streaming output. A `SessionActorNotConfiguredError` is raised with exit
output tokens, estimated cost, and duration. The `--stream` flag produces real
LLM streaming output. A `SessionActorNotConfiguredError` is raised with exit
code 1 when no actor is configured.
### Added
- **A2A module rename BDD test suite** (#8615): Comprehensive Behave tests validating that the ACP→A2A module rename is complete — verifying all 22 A2A symbols are properly exported, no legacy ACP references remain in `.py` files under `cleveragents.a2a/`, and the module docstring uses current A2A naming. The step definitions include self-contained symbol lookups to avoid cross-scenario dependency failures.
- Fixed `ReactiveEventBus.emit()` exception handler to log the full exception
message (`str(exc)`) and enable traceback forwarding (`exc_info=True`).
Previously the handler logged only the exception type name (e.g.
@@ -114,6 +61,14 @@ Changed `wf10_batch.robot` to be less likely to create files, and
worktree branch, causing ``plan apply`` to merge zero artifacts. The guard
preserves the branch per spec (§sandbox.cleanup defaults to ``on_apply``).
- **LSP subprocess cleanup on failed initialisation** (#10597): Added subprocess
cleanup in ``StdioTransport.start()`` when ``Popen()`` succeeds but then raises an
``OSError`` (e.g. exec fails in a child process before the OSError is raised). The fix
sets ``self._process = None`` before the ``Popen()`` call so that any process reference
assigned during failed initialisation is caught and cleaned up via ``stop()`` in the
:mod:`cleveragents.shared.redaction`, and transaction-based sandbox strategy using
BEGIN/COMMIT/ROLLBACK wrappers for safe, isolated database operations. SQLite-specific
checkpoint and rollback support with SAVEPOINT semantics. Support for multiple backends (PostgreSQL, SQLite, MySQL, DuckDB) via unified "DatabaseResourceHandler" and type-specific routing. BDD test
coverage in `features/database_resources.feature` (connection validation, CRUD workflows,
coverage in ``features/database_resources.feature`` (connection validation, CRUD workflows,
transaction/rollback behavior, error handling, credential masking verification) and
Robot Framework integration tests in `robot/database_resources.robot`.
Robot Framework integration tests in ``robot/database_resources.robot``.
- **TransactionSandbox infrastructure for database resource isolation** (#8608):
Implemented `TransactionSandbox` class with BEGIN/COMMIT/ROLLBACK lifecycle
management for transaction-based sandbox strategy. Wired into `SandboxFactory`
as the strategy resolver for database resource types. Added `database` resource type
registration in bootstrap builtin types and updated `_resource_registry_data.py`
Implemented ``TransactionSandbox`` class with BEGIN/COMMIT/ROLLBACK lifecycle
management for transaction-based sandbox strategy. Wired into ``SandboxFactory``
as the strategy resolver for database resource types. Added ``database`` resource type
registration in bootstrap builtin types and updated ``_resource_registry_data.py``
Below are some of the specific details of various contributions.
* Jeffrey Phillips Freeman has acted as Lead Developer, daily contributor, and Project Owner.
* Jeffrey Phillips Freeman has contributed an implementation for the invariant propagation fix (PR #10881 / issue #9131): added `_propagate_invariant_decisions()` to `SubplanService` to propagate all `invariant_enforced` decisions from parent plans to child plan decision trees during subplan spawn, satisfying the specification requirement for invariant propagation across hierarchical plan execution.
* Brent E. Edwards has contributed quality assurance, test coverage, and CI pipeline improvements.
* HAL 9000 has contributed automated implementation, bug fixes, and feature development as part of the CleverAgents automation pool.
* HAL 9000 has contributed concurrency safety improvements, including thread-safe context tier management (issue #7547) for parallel plan execution.
* HAL 9000 has contributed the plan concurrency race-condition fix (#7989): wired `LockService` into the plan lifecycle, guarding `execute_plan()` and `apply_plan()` with plan-level advisory locks and unique per-invocation owner identities to prevent silent concurrent state corruption.
* HAL 9000 has contributed the LSP subprocess cleanup on failed initialisation fix (PR #10597 / issue #11011): wired ``StdioTransport.stop()`` into the ``OSError`` handler in ``StdioTransport.start()``, preventing leaked orphan language-server processes when ``Popen()`` succeeds but then raises ``OSError`` during child process initialisation (e.g. exec failure). Includes BDD regression test coverage.
* HAL 9000 has contributed the bug-hunt-pool-supervisor non-blocking tracking fix (#7875 / PR #7957): updated step 5 to be best-effort and added rule 9 to prevent the automation-tracking-manager call from blocking the main supervisor loop.
* Jeffrey Phillips Freeman has contributed the complete AUTO-BUG-POOL to AUTO-BUG-SUP tracking prefix fix across agent-system-specification.md, automation-tracking.md documentation and agent-system-specification.md spec document, replaced with correct `AUTO-BUG-SUP` prefix used by the bug-hunt-pool-supervisor agent (#7875).
* HAL 9000 has contributed the plugin entry point security hardening fix (#7476): enforced entry point allowlist validation before importing plugin modules to prevent malicious plugin loading.
@@ -42,6 +41,3 @@ Below are some of the specific details of various contributions.
* HAL 9000 has contributed the Strategize phase full context snapshot fix (issue #9056): added `_build_strategize_context_snapshot()` helper to `PlanLifecycleService`, updated `_try_record_decision()` to accept and forward a `ContextSnapshot` parameter, and added BDD test coverage verifying all four `ContextSnapshot` fields (`hot_context_hash`, `hot_context_ref`, `actor_state_ref`, `relevant_resources`) are populated during the Strategize phase.
* HAL 9000 has contributed the ACMS context path matching fix (PR #10975 / issue #10972): corrects `_path_matches()` and `_matches_pattern()` to properly match absolute fragment paths against relative glob patterns by auto-prefixing with `**/` before calling `PurePath.full_match()`, preventing silent inefficacy of include/exclude filters for absolute paths in fragment metadata.
* HAL 9000 has contributed database resource types (PostgreSQL, SQLite) with transaction-based sandbox strategy: implemented ``DatabaseResourceHandler`` providing full CRUD operations (`read`, `write`, `delete`, `list_children`) and connection validation with automatic credential masking for PostgreSQL and SQLite backends. Includes ``TransactionSandbox`` infrastructure wired into ``SandboxFactory``, BDD test coverage in ``features/database_resources.feature``, and Robot Framework integration tests in ``robot/database_resources.robot`` (PR #10591 / issue #8608, Epic #8568).
* HAL 9000 has contributed the agents plan rollback command (PR #8674 / issue #8557): implemented checkpoint-based plan state restoration with the `agents plan rollback <plan-id> [<checkpoint-id>]` CLI command as part of Epic #8493, enabling plans to be restored to previous checkpoints, discarding post-checkpoint decisions, and resuming execution from the rolled-back state. Supported by `--yes/-y`, `--to-checkpoint`, and `--format/-f` flags. Includes comprehensive BDD test coverage (>= 97%) for rollback, decision discarding, and plan resume functionality.
* HAL 9000 has contributed the PyYAML security upgrade (PR #11012 / issue #9055): added `pyyaml>=6.0.3` dependency constraint to address known YAML parsing vulnerabilities.
* HAL 9000 has contributed the A2A module rename standardization BDD tests (PR #10583 / issue #8615): comprehensive Behave test suite validating that all 22 A2A symbols are properly exported from `cleveragents.a2a`, no legacy ACP references remain in the module source, and documentation uses correct A2A naming conventions — fixing inline imports, unused behave symbols, cross-scenario context dependencies, and missing type annotations.
# Popen may have partiallystarted the subprocess before
# raising (e.g. execve failure post-fork on some platforms).
# Ensure cleanup so the process does not leak into the caller's
# address space.
# Ensure any partially-started process is cleaned up.
# Popen() may have spawned a child before the OSError was
# raised (e.g. exec in a child fails), so we must terminate
# and wait to avoid leaking a zombie or orphan.
ifself._processisnotNone:
self.stop()
self._process=None
withcontextlib.suppress(Exception):
self.stop()
fromcleveragents.lsp.errorsimportLspError
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.