fix: critical bugs preventing messages from sending in web UI
Some checks are pending
CI / build-check-test (push) Waiting to run
Some checks are pending
CI / build-check-test (push) Waiting to run
- FIX 1: Agent constructor now wraps model/systemPrompt in initialState (was passed as top-level keys which Agent class ignores, causing it to default to Google Gemini with empty prompt and no tools) - FIX 2: chatPanel.setAgent now includes onApiKeyRequired handler using ApiKeyPromptDialog.prompt() (was missing, causing silent abort when no API key found for provider) - FIX 3: Fixed toolsFactory signature to match ChatPanel expected params (agent, iface, artifacts, runtimeFactory) instead of () => allTools - FIX 4: Removed broken allTools.map(t => t.tool) - createXxxTool() returns AgentTool directly, .tool property does not exist - FIX 5: Removed invalid convertToLlm from both Agent constructor and setAgent config (not a valid AgentOptions or setAgent config key) - FIX 6: Added pointer-events:none to empty state overlay wrapper with pointer-events:auto on interactive child to prevent input blocking
This commit is contained in:
parent
3bb3caa650
commit
606590ec80
1 changed files with 10 additions and 10 deletions
|
|
@ -241,16 +241,16 @@ async function createAgent(initialState?: AgentState) {
|
|||
const allTools = [replTool, webSearch, imageGen, tts, bash, browser, ...memTools];
|
||||
|
||||
agent = new Agent({
|
||||
initialState: {
|
||||
model,
|
||||
systemPrompt: SYSTEM_PROMPT,
|
||||
tools: allTools.map((t) => t.tool),
|
||||
convertToLlm: customConvertToLlm,
|
||||
...initialState,
|
||||
},
|
||||
});
|
||||
|
||||
chatPanel.setAgent(agent, {
|
||||
toolsFactory: () => allTools,
|
||||
convertToLlm: customConvertToLlm,
|
||||
onApiKeyRequired: (provider: string) => ApiKeyPromptDialog.prompt(provider),
|
||||
toolsFactory: (_agent, _iface, _artifacts, _runtimeFactory) => allTools,
|
||||
});
|
||||
|
||||
registerCustomMessageRenderers(chatPanel);
|
||||
|
|
@ -612,8 +612,8 @@ function renderApp() {
|
|||
<!-- CHAT AREA -->
|
||||
<div class="flex flex-col flex-1 min-w-0 min-h-0 relative ${getViewClasses()}">
|
||||
${!hasMessages ? html`
|
||||
<div class="absolute inset-x-0 top-0 z-10 flex flex-col" style="bottom:130px" @suggestion=${handleSuggestion}>
|
||||
<jae-empty-state style="display:flex;flex-direction:column;flex:1;width:100%;min-height:0"></jae-empty-state>
|
||||
<div class="absolute inset-x-0 top-0 z-10 flex flex-col" style="bottom:130px;pointer-events:none" @suggestion=${handleSuggestion}>
|
||||
<jae-empty-state style="display:flex;flex-direction:column;flex:1;width:100%;min-height:0;pointer-events:auto"></jae-empty-state>
|
||||
</div>
|
||||
` : html``}
|
||||
<div id="chat-wrapper" class="flex flex-col flex-1 min-h-0">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue