mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-04-28 00:00:52 -07:00
- Added functionality to restore heartbeat timers and alarms for active agents upon service initialization. - Introduced methods to retrieve active background tasks and cancel them via the UI. - Enhanced alarm clock tool to persist alarm data in the database, ensuring alarms survive app restarts. - Updated agent instance schema to include scheduled alarm data. - Modified prompt concatenation logic to support context window size for message history. - Removed system prompt parameter from model parameters schema and related components. - Improved UI to display and manage background tasks, including heartbeat and alarm details.
3.4 KiB
3.4 KiB
Agent Enhancement — Session 2026-03-05
Changes Made
1. Agent Switcher moved to header with AutoComplete search
- Moved
AgentSwitcherfromInputContainer(bottom left) toChatHeader(top bar, next to title) - Dropdown now opens downward instead of upward
- Added MUI
Autocompletewith inline search box — filters agents by name and description - Cleaned up unused props from
InputContainerandChatTabContent
2. Tool Approval wired into execution flow
evaluateApproval()+requestApproval()now called before everyexecuteToolCall()indefineTool.ts- Also integrated into
executeAllMatchingToolCalls()for batch approval - Denied tools return an error tool result and yield back to the agent
- Pending tools block execution until the user responds via
resolveApproval()
3. Context window token truncation
- Added
contextWindowSizeoptional field toFullReplacementParameterSchema - After
filterMessagesByDuration(), messages are now trimmed by token count - Oldest messages are removed first; 70% of context budget allocated to history
- Default set to 120,000 tokens in both Task Agent and Plan Agent configs
4. Heartbeat auto-wake configuration
- New
AgentHeartbeatConfiginterface onAgentDefinition(enabled, intervalSeconds, message, activeHoursStart/End) heartbeatManager.tsmanages per-agentsetIntervaltimers- Heartbeats started after successful framework run, stopped on close/cancel/delete
- Active hours filtering supports overnight ranges (e.g. 22:00-06:00)
- Persisted via
heartbeatcolumn onAgentDefinitionEntity
5. Alarm clock recurring support
alarm-clocktool now accepts optionalrepeatIntervalMinutesparameter- First fire happens at the specified
wakeAtISO, then repeats at the interval cancelAlarm()clears bothsetTimeoutandsetIntervaltimers
6. Tool result smart truncation
addToolResult()now truncates results exceeding 32,000 characters- Truncated results include a
[... truncated]marker with original length - Prevents a single wiki-search result from consuming the entire context window
7. Step definition fix for embedding-only mock rules
agent.tsstep definition now accepts mock rules with onlyembedding(noresponse)- Previously
if (response) rules.push(...)would skip embedding-only rules
Files Changed
src/pages/ChatTabContent/components/AgentSwitcher.tsx— Rewritten with Autocompletesrc/pages/ChatTabContent/components/ChatHeader.tsx— Now hosts AgentSwitchersrc/pages/ChatTabContent/components/InputContainer.tsx— Removed AgentSwitchersrc/pages/ChatTabContent/index.tsx— Props routing updatedsrc/services/agentDefinition/interface.ts— Added AgentHeartbeatConfigsrc/services/agentDefinition/index.ts— Heartbeat in CRUD and initializationsrc/services/agentInstance/heartbeatManager.ts— New filesrc/services/agentInstance/index.ts— Heartbeat lifecycle integrationsrc/services/agentInstance/tools/defineTool.ts— Approval + truncation wiringsrc/services/agentInstance/tools/alarmClock.ts— Recurring alarm supportsrc/services/agentInstance/promptConcat/modifiers/fullReplacement.ts— Token trimmingsrc/services/agentInstance/agentFrameworks/taskAgents.json— contextWindowSize defaultssrc/services/database/schema/agent.ts— Heartbeat columnfeatures/stepDefinitions/agent.ts— Embedding rule fix