﻿# Stop tasks and understand what remains

[中文](../../zh-CN/protection/lifecycle.md) · [Protection guide](index.md) · [Configuration and activation](configuration.md)

Before stopping or removing a session, identify its execution process, files and authorization. Ending execution, deleting a workspace and revoking access are separate operations. A new chat can reconnect to an existing process; a retained directory does not mean a process can resume from memory.

This guide uses public integration contracts and the December 3, 2026 [Windows](../reference/windows-verification-2026-12-03.md), [macOS](../reference/macos-verification-2026-12-03.md) and [Linux](../reference/linux-verification-2026-12-03.md) records. It adds no lifecycle test. Windows measurements used installed **0.11.84**. The public **v0.11.85** macOS/Linux archives contained executable **0.11.48**. Keep those versions separate from the plugin contracts below.

## Choose the execution entry

| Platform / entry | Start and normal exit | Stop and retention boundary |
| --- | --- | --- |
| Windows personal CLI | Use a prepared configuration and the [documented CLI entry](../development/integration-guide.md). `run` starts a short task; `self-confine` starts the selected long-lived program. Exit that program normally | Tested timeout behavior is below. A retained workspace and prepared authorization are not removed just because the task ends |
| Windows Codex CLI | Start the protected `app-server`, then connect the ordinary TUI as the [Codex guide](../agents/codex.md) describes | Exit the TUI session, then stop the server in its original terminal and confirm exit. Disconnecting a client does not establish server termination; a new connection can reuse it |
| Windows DSH Desktop plugin | Use DSH's normal plugin and protected launch workflow; save work and quit Desktop normally | Disable/remove through DSH, then exit and reopen for future activation. An existing Host cannot lose its AppContainer merely because the plugin was disabled. See [DSH operations](../agents/dsh-operations.md#disable-and-remove) |
| Windows OpenCode Desktop plugin | Follow **Settings → FinShield**, preparation and the prompted manual exit/reopen | The integration protects the execution Host while Desktop Main remains ordinary. Plugin removal retains native runtime, configuration and authorization. Use the [OpenCode guide](../agents/opencode.md) for its own flow; DSH cleanup is not its contract |
| Windows other desktop / test plugins | Follow the selected [Agent entry](../agents/compatibility.md), including its save/exit/reopen instructions | Do not assume DSH/OpenCode exit or removal behavior applies to another launcher. Kilo's test entry has incomplete session-restoration/exit acceptance |
| macOS personal CLI | Select wrapper YAML at launch. `program_mode: short-lived` uses `run`; `interactive` uses `self-confine`. Exit the selected program normally | The 0.11.48 SIGTERM test left a child running. Keep interruption separate from timeout; see below. The `--visual` comparison server is stopped with **Ctrl+C** in its terminal, as the [demo guide](../getting-started/demos.md#macos-and-linux-compare-file-access) describes |
| Linux personal CLI | Select wrapper YAML and keep matching helpers. Use the supported mode after [host setup](../getting-started/install.md#linux) | In the measured public x64 linuxkit environment, `run` worked and `self-confine` stopped before launching the command because Landlock was only partially enforced. SIGTERM results differed by network mode |
| macOS/Linux desktop or plugin entries | Check a delivered entry separately in the [compatibility matrix](../agents/compatibility.md) | The cited personal-CLI records establish no desktop/plugin stop, session-retention or uninstall contract |
| Managed / SaaS on any platform | Use the administration and execution interfaces delivered for that service | Public personal/plugin results establish no service session TTL, running-task termination API, tenant isolation or retention policy. Confirm them in the [delivery scope](../enterprise/index.md) |

## Exit, timeout and interruption have different results

Normal exit lets the program perform its own save and shutdown work. A finite `timeout_ms` bounds the selected execution; it is not a request to save a document or cancel a remote API operation. **Ctrl+C**, a termination signal, application exit and a timeout can follow different paths. A terminal closing or wrapper disappearing is insufficient proof that its children stopped.

| Recorded environment / operation | Actual observation | What remains outside the result |
| --- | --- | --- |
| Windows 11 Pro 23H2 x64, installed 0.11.84, `run` with `timeout_ms: 1500` | A five-second parent/child wait returned exit **124**, `timed_out: true`, `termination_reason: timeout_killed`; the captured child PID was no longer running. Job queries showed kill-on-close | Independent services, every desktop/plugin lifecycle, and other versions were not accepted by that test |
| Same Windows installation, separate `self-confine` timeout | Five-second wait returned exit **124** and `termination_reason: timeout_killed` | The parent/child check above was a `run` test; it does not independently establish every `self-confine` descendant outcome |
| macOS 26.6.1 arm64, 0.11.48 personal CLI | Timeout stopped the named short task. In a separate SIGTERM trial, the wrapper stopped but `/bin/sleep 30` remained alive until cleanup | No universal descendant-reaping or memory-resume guarantee |
| Linux 0.11.48, privileged Docker Desktop linuxkit, emulated amd64 | Timeout stopped the named `run`. SIGTERM with `network: host` left a child alive; with `network: none`, wrapper and child both exited | Docker-on-Mac is not native Linux server acceptance. Changing networking solely to obtain a cleanup result is not a prescribed recovery |

The [resource guide](resource-limits.md) owns timeout configuration and its bounded checks. The dated platform records retain the exact conditions and failures. A request already accepted by an external service may continue after the local program stops; check that service's supported cancellation interface separately.

### Finish a task and inspect its children

1. Save work through the Agent/application's supported interface. Record the program/Host/server and any test child PIDs while the task is running; keep their identity and start time with the result.
2. Use the entry's normal exit first. For Codex's Windows remote route, end the client session and then the protected server. If you interrupt a task, record how; do not label an interruption a clean application exit.
3. Check the exact recorded processes from an ordinary host session. These are read-only OS checks; replace the example PID. A PID can be reused, so compare the program and start time where available.

```powershell
# Windows: inspect the recorded task PID, not every process with this name.
Get-Process -Id 12345 -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime
```

```sh
# macOS or Linux: inspect a previously recorded task/child PID.
ps -p 12345 -o pid=,ppid=,etime=,comm=
```

4. Repeat for recorded children and independently running services used by the task. A missing parent does not prove they ended. If a child remains, stop that owned test process through its owning application/runner or the OS's normal process controls after checking its identity. Do not kill every process with the same name.
5. Inspect the files and any receiver state independently, keep the needed evidence, then remove only disposable fixtures whose absolute paths you recorded. Stopping does not undo partial file changes or remove a remote request.

An empty process query only concerns the selected PID at that moment; it is not proof of every process in an unrecorded tree. If you cannot establish which task owns a remaining process, retain the evidence and [get help](../getting-started/install.md#get-help).

## What persists after execution?

| State | What to expect in these local entries | What must not be inferred |
| --- | --- | --- |
| Workspace files | Files already written remain subject to their ordinary storage and file permissions. Check partial output after failure | No automatic Git reset, backup, rollback, expiry or deletion when a task exits |
| Agent conversation / session | Retention and reopening belong to that Agent/version. A Codex client can connect to a server that already exists | Reopening a chat is not a fresh FinShield execution process or memory checkpoint |
| Process memory | The reviewed public entries do not provide a documented general FinShield pause/resume or memory-snapshot interface | A persistent directory or an Agent's resume feature does not restore an arbitrary process's memory |
| Configuration and Windows preparation | Saved configuration and prepared permissions have their own lifecycle; a new task can still use them while installed and prepared | Task exit does not revoke authorization. Saving a new policy does not change an old running process; follow [activation](configuration.md) |
| Logs / retained content | Retention is separate from task completion. The Windows PII example can retain original content when configured | Redacted delivery, task exit or plugin removal does not prove local originals were erased |

These guides establish no common local-session TTL or automatic workspace garbage collector. Choose a retention/backup policy for files you own, and follow the Agent's own session controls. Use the [evidence index](../reference/verification.md) for the recorded scope rather than assuming a timed test establishes storage cleanup.

## Parallel work needs explicit boundaries

| Shared resource | What to decide before parallel tasks |
| --- | --- |
| Files and worktrees | Give tasks appropriate paths and file rules. Git worktrees separate working directories; they do not create different sandbox identities or deny access to another permitted path |
| Windows authorization / security domain | DSH operations document that two runtime directories using the same user/domain ID share authorization; revoking that ID affects both. Distinct IDs have independent authorization. Do not rename IDs as an isolation shortcut; use a supported deployment workflow |
| Agent state, dependencies and caches | Check whether both tasks can read/write shared state. Separate project directories do not isolate a shared account, cache, plugin, build daemon or MCP service |
| Ports and external services | Choose unused local ports for separate servers and connect each client to its intended protected server. A separately running browser/MCP/database service needs its own coverage check |
| Resource quotas | Confirm whether a configured limit covers the task's Job/cgroup rather than each folder. A local process limit is not a tenant-concurrency or spending budget; see [resource scope](resource-limits.md) |

The public records do not establish every parallel-task combination, cross-session dependency isolation or managed tenant boundary. Test the particular shared resource with disposable data before relying on isolation between tasks.

## Stop, disable, revoke, delete and uninstall

| Action | What it changes | What can remain / subsequent launch |
| --- | --- | --- |
| Stop the task | Ends the selected execution when its actual process/child check confirms it | Files, credentials, configuration and authorization can remain; a new protected launch may still be permitted |
| Disable an integration | Changes future activation through that host's controls | DSH requires exit/reopen; an existing protected Host stays confined. Other integrations need their own disable contract. Disabling is not a way to revoke an account credential |
| Revoke FinShield authorization | Removes the selected authorization through the installation's supported workflow | Existing files and external credentials remain. Treat the next protected launch as requiring preparation/authorization again; revocation alone is not proof that every existing process was terminated |
| Delete an Agent session or workspace | Removes the state selected by that Agent or the exact owned files you delete | It is separate from process termination, Windows authorization, other copies/backups and logs. Check the Agent's deletion scope first |
| Remove a plugin | Removes host registration/package according to its manager | DSH/OpenCode contracts retain native runtime, configuration and authorization. Remaining native entries may still launch if otherwise installed and prepared |
| Uninstall the native runtime | Uses that installation's normal uninstaller; see [installation](../getting-started/install.md#update-and-uninstall) | DSH's native removal revokes its selected user/domain ID while retaining Effective configuration, other user files and DSH accounts/sessions. Shared use of that ID is affected. Do not apply this contract to every integration |
| Revoke a third-party token / sign out | Changes access at the credential issuer or Agent account | Stopping FinShield or deleting a local session does not revoke a copied token or an already accepted remote task. Use the issuer's supported controls and check their actual result |

On macOS/Linux, finish protected tasks before replacing or removing extracted programs and helpers. Removing the directory does not establish removal of configuration, certificates, model data, records or credentials. No universal FinShield managed/SaaS cancel/revoke command is supplied here. A service's **cancel pending** operation, if delivered, must not be described as terminating an already running task without that service's contract and evidence.

## Keep or export the work before cleanup

For a Git worktree you own, standard `git status` and `git diff` can show tracked-file changes; inspect untracked files separately. Those are Git operations, not a FinShield snapshot or automatic export. FinShield's reviewed public local entries establish no universal workspace diff/export, session archive or rollback interface. Use the Agent/application's documented export if it has one, or copy the exact output files you need before deletion.

Keep an ordinary backup of important files. Avoid commands that reset a repository or recursively delete a parent directory as part of task shutdown. For support, retain versions, entry, configuration scope, exit/termination result, recorded process identities, independently checked files and redacted original errors; never include credentials or private conversations.
