-
-
Notifications
You must be signed in to change notification settings - Fork 396
feat: run local agents through an on-demand daemon #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
466734d
docs: revise local agent ownership around daemon
Waishnav 5aeaa56
refactor: add durable local agent runtime core
Waishnav c4e821a
refactor: make local agent core host-independent
Waishnav abeb678
feat: add standalone local agent daemon lifecycle
Waishnav d17898a
feat: add local agent daemon IPC protocol
Waishnav 9eb9b91
refactor: move manager and store ownership into agent daemon
Waishnav ed7b41b
refactor: route CLI agent commands through daemon client
Waishnav ad1f0e9
docs: route MCP agent work through the daemon
Waishnav cee6840
test: cover daemon startup shutdown and recovery
Waishnav e34e41f
feat: bound daemon shutdown and recovery
Waishnav 6cf9b71
docs: document daemon recovery and diagnostics
Waishnav 42c5bd1
chore: sync daemon package metadata
Waishnav 414864e
fix: harden local agent runtime pooling
Waishnav 037c78b
refactor: make daemon agent ownership explicit
Waishnav b825a3d
fix: harden local agent daemon ownership
Waishnav d8223d3
fix: serialize local agent session release
Waishnav bf266e1
fix: enforce workspace scoped agent access
Waishnav 95f2962
test: prove daemon ownership and socket shutdown
Waishnav 03be064
test: make daemon ownership check cross-platform
Waishnav 2c2d8a3
fix: force provider cleanup during daemon shutdown
Waishnav 204272d
fix: enforce combined workspace list scopes
Waishnav dafa843
fix: close timed-out daemon client sockets
Waishnav 124638e
fix: publish daemon lock ownership atomically
Waishnav 9f23b7c
fix: harden runtime acquisition and turn tracking
Waishnav ed67a53
fix: coordinate runtime shutdown with session release
Waishnav 22a5ebf
fix: block new session releases during shutdown
Waishnav b99b32b
refactor: require client agent list scope
Waishnav 77a5f10
refactor: avoid provider probes in availability checks
Waishnav File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Local agent daemon | ||
|
|
||
| Local agent execution is owned by an on-demand `devspace-agentd` process, not | ||
| by the MCP server and not by an individual CLI invocation. The daemon is an | ||
| internal implementation detail: the normal workflow remains: | ||
|
|
||
| ```text | ||
| devspace agents run/continue/show/ls | ||
| │ | ||
| ▼ | ||
| devspace-agentd | ||
| │ | ||
| ├── LocalAgentManager | ||
| ├── LocalAgentStore | ||
| ├── LocalAgentRuntimePool | ||
| └── provider runtimes | ||
| ``` | ||
|
|
||
| The CLI starts the daemon automatically when an agent command needs it. The | ||
| MCP server can use the same local client when an MCP operation needs agent | ||
| functionality, but `devspace serve` is not required for local-agent execution. | ||
| The daemon is scoped to one DevSpace `stateDir`, so one SQLite store and one | ||
| runtime owner serve all clients using that configuration. | ||
|
|
||
| Communication uses a private Unix domain socket on Linux/macOS or a named pipe | ||
| on Windows. The endpoint is not exposed through the public MCP HTTP port. | ||
| Provider session identifiers and logical agent records are durable; live | ||
| provider runtimes are disposable and may be recreated after a daemon restart. | ||
|
|
||
| The daemon state directory contains the socket or pipe identity, an atomic | ||
| lock, a PID marker, and diagnostic logs. A second client cannot start another | ||
| daemon for the same state directory. Stale lock and socket files are recovered | ||
| only after the recorded PID is no longer alive. | ||
|
|
||
| The daemon is started on demand and may exit after its active turns, clients, | ||
| and warm runtime idle periods have ended. Users do not need to manage it during | ||
| normal operation. Diagnostic commands are available for startup, process, and | ||
| cleanup problems: | ||
|
|
||
| ```bash | ||
| devspace agents daemon status | ||
| devspace agents daemon stop | ||
| devspace agents daemon logs | ||
| ``` | ||
|
|
||
| Agent identity is explicit at the client boundary. `agents run` starts a new | ||
| logical agent from a profile or provider; `agents continue <id>` continues an | ||
| existing logical agent. Provider session IDs are never accepted as logical | ||
| agent IDs, and the daemon does not resolve ambiguous prefixes. | ||
|
|
||
| Shutdown gives active turns a bounded graceful window. If that window expires, | ||
| the process exits with active records left durable; the next daemon startup | ||
| reconciles stale `starting` and `running` records to `error` without discarding | ||
| their `providerSessionId` or `latestResponse`. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.