Skip to content

feat(context): add reset() method to WorkflowContext#4

Closed
xingzihai wants to merge 1 commit intoPracticalMind:mainfrom
xingzihai:add-reset-method
Closed

feat(context): add reset() method to WorkflowContext#4
xingzihai wants to merge 1 commit intoPracticalMind:mainfrom
xingzihai:add-reset-method

Conversation

@xingzihai
Copy link
Copy Markdown

Summary

This PR adds a reset() method to WorkflowContext that restores the context to its initial state.

Changes

  • Added reset() method to WorkflowContext in gateframe/core/context.py
  • The method restores confidence to _initial_confidence and clears _history
  • Added logging for workflow reset events
  • Added 4 new test cases covering:
    • Basic reset behavior (confidence restoration)
    • History clearing
    • Custom initial confidence handling
    • Context reuse across multiple runs

Test Results

All 21 tests pass, including the 4 new tests for the reset functionality.

Related Issue

Closes #3

@practicalmind-dev
Copy link
Copy Markdown
Contributor

Just a formatting issue, run ruff format . locally before pushing and it should pass.

@practicalmind-dev
Copy link
Copy Markdown
Contributor

Hey, thanks for the quick turnaround on this, the implementation is solid.

I asked about the lint failure but didn't hear back. In the meantime a second PR came in that covers the same change and is passing CI, so I'm going to go ahead and merge that one to keep things moving.

No hard feelings, if you want to contribute further, you're very welcome.

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.

WorkflowContext: add reset() method

2 participants