fix: critical bugs preventing messages from sending in web UI
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:
JAE 2026-03-27 17:08:52 +00:00
parent 3bb3caa650
commit 606590ec80

View file

@ -241,16 +241,16 @@ async function createAgent(initialState?: AgentState) {
const allTools = [replTool, webSearch, imageGen, tts, bash, browser, ...memTools]; const allTools = [replTool, webSearch, imageGen, tts, bash, browser, ...memTools];
agent = new Agent({ agent = new Agent({
initialState: {
model, model,
systemPrompt: SYSTEM_PROMPT, systemPrompt: SYSTEM_PROMPT,
tools: allTools.map((t) => t.tool),
convertToLlm: customConvertToLlm,
...initialState, ...initialState,
},
}); });
chatPanel.setAgent(agent, { chatPanel.setAgent(agent, {
toolsFactory: () => allTools, onApiKeyRequired: (provider: string) => ApiKeyPromptDialog.prompt(provider),
convertToLlm: customConvertToLlm, toolsFactory: (_agent, _iface, _artifacts, _runtimeFactory) => allTools,
}); });
registerCustomMessageRenderers(chatPanel); registerCustomMessageRenderers(chatPanel);
@ -612,8 +612,8 @@ function renderApp() {
<!-- CHAT AREA --> <!-- CHAT AREA -->
<div class="flex flex-col flex-1 min-w-0 min-h-0 relative ${getViewClasses()}"> <div class="flex flex-col flex-1 min-w-0 min-h-0 relative ${getViewClasses()}">
${!hasMessages ? html` ${!hasMessages ? html`
<div class="absolute inset-x-0 top-0 z-10 flex flex-col" style="bottom:130px" @suggestion=${handleSuggestion}> <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"></jae-empty-state> <jae-empty-state style="display:flex;flex-direction:column;flex:1;width:100%;min-height:0;pointer-events:auto"></jae-empty-state>
</div> </div>
` : html``} ` : html``}
<div id="chat-wrapper" class="flex flex-col flex-1 min-h-0"> <div id="chat-wrapper" class="flex flex-col flex-1 min-h-0">