* feat: add --prompt flag for foreground agent mode
- Add --prompt/-p flag to 'agent run' command
- When --prompt is provided, runs agent in foreground mode
- Creates agent, executes Ask() with the prompt, prints response, and exits
- Supports both agent name and --config file input modes
- Follows existing code patterns in the repository
* fix: correct JobResult field access for error and response
---------
Co-authored-by: localai-bot <localai-bot@noreply.github.com>
* feat: implement 'agent run' CLI command (#448)
- Add 'local-agi agent run' command supporting agent name or config file
- Support 'local-agi agent run <name>' to run agent from registry (pool.json)
- Support 'local-agi agent run --config <file.json>' to run from JSON config
- Extract web server into 'local-agi serve' subcommand
- Implement agent name lookup from registry
- Add JSON config file parsing and validation
- Create standalone agent execution logic
- Add proper error handling for invalid inputs
- Reuse existing service factories (actions, connectors, filters, skills)
- Environment variable fallback for config values
- No web server - agent runs in foreground with clean SIGINT/SIGTERM handling
References: https://github.com/mudler/LocalAGI/issues/448
* refactor(cmd): use pool to start agent instead of duplicating logic
Replace ~220 lines of duplicated agent initialization code in
startStandaloneAgent() with a call to pool.StartAgentStandalone().
The new pool method delegates to the existing startAgentWithConfig(),
eliminating code duplication between the CLI and the pool.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: add default help command to root
* fix: default to serve command when no subcommand provided
The e2e tests fail because when the container starts with no arguments,
the root command shows help instead of starting the web server.
Changed the root command to call serveCmd.RunE() directly when no
subcommand is provided, ensuring the web server starts by default.
This fixes the CI e2e test failure where the web server wasn't starting.
* fix: add serve subcommand to Dockerfile ENTRYPOINT
* refactor: remove unused GetRAGProvider function
* refactor: centralize env var setup in cmd/env.go
---------
Co-authored-by: localai-bot <localai-bot@noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: uploadJobResultFiles was passing msgTs (placeholder reply timestamp)
as thread_ts for file uploads. Slack's API rejects this - it requires the
parent thread timestamp, not a reply's timestamp.
Changes:
1. Use 'ts' (thread root timestamp) instead of 'msgTs' in replyToUpdateMessage
2. Fix type handling in attachmentsFromMetadataOnly to handle []interface{}
3. Download and upload generated images (e.g., DALL-E) as files instead of
just adding link attachments, to preserve temporary URLs
4. Remove dead code: generateAttachmentsFromJobResponse was never called
This matches Telegram connector behavior where files are properly uploaded
rather than just referenced by URL.
Co-authored-by: localai-bot <localai-bot@noreply.github.com>
* Merge origin/main and resolve conflicts: keep all features including auto-compaction and evaluation
* fix: resolve merge conflict syntax errors in config.go
* feat: wire auto-compaction options to cogito
Wire enableAutoCompaction and autoCompactionThreshold options to
cogito.WithCompactionThreshold() when starting the agent.
---------
Co-authored-by: Team Coding Agent 1 <team-coding-agent-1@local>
Updated github.com/mudler/cogito from
v0.9.2-0.20260223101954-070948df04f7 to
v0.9.2-0.20260225234859-b76691637703
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
* feat: add scheduler task template and template-based skills prompt
- Add WithSchedulerTaskTemplate option for recurring tasks run by scheduler
- Expose scheduler_task_template in core/state/config.go for user configuration
- Add WithSkillPromptTemplate option for custom skill prompt templates
- Use {{.Skills}} slice in templates to iterate over Skill.Name, Skill.Description
- Default template mimics current XML behavior with <available_skills> format
- Rename customIntro to customTemplate in services/skills for consistency
* cleanups
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
* Update core/state/config.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>