You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d8809e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: fern/versions/latest/pages/agent-server/integrate-existing-agents.mdx
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ For Environment Server execution, implement these `SimpleResponsesAPIAgent` hook
16
16
an `AgentSessionState`. If setup fails and cleanup cannot finish, raise
17
17
`AgentSessionSetupError(state, error=original_error)` so close can retry cleanup.
18
18
-`_close_agent_session_state(state)`: stop the harness process group, collect observations,
19
-
and release the session. Explicitly detached task services remain for the sandbox owner.
19
+
and release the session. Preserved task services remain for the sandbox owner.
20
20
Missing termination evidence remains retryable; a final negative receipt fails the activation
21
21
and skips verification while close releases the borrowed connection.
22
22
@@ -31,6 +31,14 @@ provider's exec request. Cancellation can kill the provider's entire process gro
31
31
the supervisor when it is already the group leader (as with the local provider).
32
32
`setsid()` alone does not guarantee cleanup; the close ordering does.
33
33
34
+
The shared supervisor stops live harness-group processes and reaps its children. Before
35
+
signalling a timed-out or closing harness, it records already adopted children, typically
36
+
services from completed tools. It preserves those outside the harness group and drains
37
+
newly adopted children within the cleanup deadline, including tools in separate sessions.
38
+
After natural CLI exit, unfinished tools in separate sessions cannot be distinguished
39
+
from services. Adoption races, PID reuse, and later service forks also limit this cutoff;
40
+
it is not a security boundary or a guarantee that task state cannot change.
41
+
34
42
## Tools in Agent vs. Resources Server
35
43
36
44
Existing agents may come with predefined tools, allowing you to leverage them directly and use the Resources server to supplement with any additional external tools. When building a new environment, prefer defining tools in the Resources server rather than the Agent server. This separation of concerns allows different agents to share the same Resources server without duplicating tool logic.
0 commit comments