Skip to content

Add configurable taskFlow memory policies and session reset handling for verifier/developer#1

Merged
hlibr merged 2 commits into
masterfrom
codex/find-and-fix-critical-bug
Apr 9, 2026
Merged

Add configurable taskFlow memory policies and session reset handling for verifier/developer#1
hlibr merged 2 commits into
masterfrom
codex/find-and-fix-critical-bug

Conversation

@hlibr

@hlibr hlibr commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Introduce configurable memory policies to control whether developer and verifier agent sessions are preserved across retries and different failure modes.
  • Ensure verifier malformed outputs and runtime errors can be classified separately from normal verification failures so memory reset policies can be applied precisely.

Description

  • Add a taskFlow.memory schema with options keepDeveloperMemory, keepVerifierMemoryOnDeveloperFailure, and verifierSelfFailureMemory (values: keep, reset, reset_on_malformed_output) in config.ts and load default values when missing.
  • Extend the task flow engine (runTaskFlow) to detect whether a verifier transition was due to an unmatched/malformed output versus a verification failure, and pass a reason (verification_failed | malformed_output | error) into applyVerifyFailure.
  • Implement resetStageMemory in index.ts to dispose existing runners, increment per-stage sessionResetCounts, and create new session files, and call it from applyVerifyFailure according to the configured memory policy.
  • Add sessionResetCounts to TaskState in state.ts so resets are tracked per task stage.
  • Update the default workflow file /.pi/workflows/default.workflow.json and README.md to include new taskFlow.memory defaults and documentation.
  • Add and update unit tests in tests/config.test.ts, tests/config-extended.test.ts, and tests/engine.test.ts to cover schema validation, defaults, custom memory policies, verifier retry behavior, and reason propagation.

Testing

  • Ran the unit test suite for the workflow orchestrator (tests/config.test.ts, tests/config-extended.test.ts, tests/engine.test.ts) which exercise schema loading, memory defaults/validation, and runTaskFlow behaviors, and all tests passed.

Codex Task

@hlibr hlibr merged commit abb413c into master Apr 9, 2026
1 check passed
@hlibr hlibr deleted the codex/find-and-fix-critical-bug branch April 9, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant