Skip to content

#301 - ProcessManager: restore the parent process history after a failed process, and reset it between executions - #302

Merged
njoubert-cleverage merged 1 commit into
mainfrom
301
Oct 15, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
301

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Fixes #301.

  • ProcessManager::execute() restores the history of the parent process (if any) in a finally block. doExecute() only restored it when the process succeeded: after a failed sub-process caught by its parent (process_executor task with the skip error strategy), the next logs of the parent were attributed to the sub-process (process_id / process_code / process_context of the Monolog processors), and the history of a failed process was left after its execution.
    The restore is done after the Critical process failure log and the cleverage_process.fail event, which are still attributed to the failed process (a finally in doExecute() would have lost it).
  • ProcessManager implements ResetInterface (kernel.reset tag): processed iterables / blockings, history and current task are reset between two messages of a long-running worker (Messenger / scheduler of the UI bundle).
  • ProcessManagerStopCheckerTest relied on the history left after the failure: it now checks it when the failed event is dispatched.

Checked in process-bundle-demo with the reproduction of the issue: the logger task of the parent logs "process_code":"demo.subprocess_failure" (was the child), Critical process failure keeps the child code; debug:container shows the kernel.reset tag.

Out of scope: the current task (getTaskConfiguration()) of the parent is set to null once a sub-process has ended (successfully or not), until the next task; unchanged.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: only the history returned by getProcessHistory() after a failed process changes (it was the failed one, now the parent one or null); reset() is a new method.

🤖 Generated with Claude Code

…led process, and reset it between executions

- execute(): restore the history of the parent process (if any) in a
  finally block. doExecute() only restored it when the process succeeded:
  after a failed sub-process caught by its parent (process_executor task
  with the skip error strategy), the next logs of the parent were attributed
  to the sub-process by the Monolog processors, and the history of a failed
  process was left after its execution. Restored after the "Critical process
  failure" log and the cleverage_process.fail event, which are still
  attributed to the failed process.
- Implement ResetInterface (kernel.reset tag): processed iterables /
  blockings, history and current task are reset between two messages of a
  long-running worker.
- ProcessManagerStopCheckerTest relied on the history left after the
  failure: check it when the failed event is dispatched.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit f44fd23 into main Oct 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ProcessManager: process history not restored after a failed process, and not reset between executions

1 participant