home / skills / bdambrosio / cognitive_workbench / osworld-reset
This skill resets the OSWorld environment in soft or hard mode, preserving state or restoring from snapshot to support reflective testing.
npx playbooks add skill bdambrosio/cognitive_workbench --skill osworld-resetReview the files below or copy the command above to add this skill to your agents.
---
name: osworld-reset
type: python
description: "Reset the OSWorld environment. Soft mode clears step counter only. Hard mode calls DesktopEnv.reset() to revert to snapshot state."
schema_hint:
value: "string ('soft' or 'hard')"
mode: "string ('soft' or 'hard', alternative to value)"
out: "$variable"
examples:
- '{"type":"osworld-reset","mode":"soft","out":"$reset"}'
- '{"type":"osworld-reset","value":"hard","out":"$reset"}'
---
# OSWorld Reset Tool (Level 4)
## Input
- `mode` or `value`: string (required) - "soft" or "hard"
- `soft`: Clear step counter only, no state change
- `hard`: Call DesktopEnv.reset() to revert environment to snapshot state
## Output
- Note ID (bound to `out` variable) containing:
- `text`: formatted reset result
- `format`: "text"
- `metadata`: reset data including:
- `success`: boolean - whether reset succeeded
- `mode`: string - reset mode used
- `step_counter`: integer - step counter after reset (0)
## Configuration
- `OSWORLD_URL` environment variable (defaults to `http://localhost:3002`)
- Or pass `osworld_url` in character config's `osworld_config` section
## Common Workflow
```json
{"type":"osworld-reset","mode":"hard","out":"$reset"}
{"type":"osworld-observe","out":"$obs"}
{"type":"osworld-execute","python":"pyautogui.click(100,200)","out":"$result"}
```
## Notes
- **Soft reset**: Only clears step counter. Useful for reflection without losing state.
- **Hard reset**: Reverts environment to snapshot state. Critical for counterfactual replay and reflection.
- Hard reset is the key reflection enabler - allows Jill to explore "what if" scenarios.
This skill resets an OSWorld environment either softly or hard. Soft mode clears only the internal step counter; hard mode reverts the desktop environment to a saved snapshot by calling DesktopEnv.reset(). Use it to control experiment state and support reflection or replay workflows.
The skill accepts a required string parameter: "soft" or "hard". In soft mode it updates the environment metadata to set the step counter back to zero without changing any running state. In hard mode it invokes DesktopEnv.reset() on the OSWorld instance (using OSWORLD_URL or supplied config) to restore the snapshot state and reset counters. The skill returns a note containing formatted text and metadata about success, mode, and step_counter.
What environment does hard reset target?
Hard reset calls DesktopEnv.reset() against the OSWorld instance configured via OSWORLD_URL or the osworld_config entry in character config.
Will soft reset lose application state?
No. Soft reset only clears the internal step counter and does not change running applications, windows, or files.