Compare commits

...

10 Commits

Author SHA1 Message Date
Zamil Majdy
80104fbb3b Merge branch 'dev' of github.com:Significant-Gravitas/AutoGPT into feat/ask-question-tool 2026-04-02 15:55:52 +02:00
Zamil Majdy
988edd6fe9 fix(platform): validate options/keyword params and pass sessionId to ClarificationQuestionsCard
- Validate options is actually a list (LLM may send string); coerce gracefully
- Validate keyword is a string
- Pass sessionId prop to ClarificationQuestionsCard for localStorage persistence
- Add test for invalid options coercion
2026-04-02 14:34:58 +02:00
Zamil Majdy
078e89f8a6 fix(backend): validate non-empty question in ask_question tool
Reject empty/whitespace-only question strings with ValueError instead
of producing an empty clarification card.
2026-04-02 14:18:58 +02:00
Zamil Majdy
9990e9e841 fix(backend): update prompting_test to match renamed guide section
The clarification section was renamed from "Clarifying Before Building"
to "Clarifying — Before or During Building". Update assertions and add
a test verifying ask_question is referenced.
2026-04-02 14:14:57 +02:00
Zamil Majdy
032fb061bb refactor(platform): consolidate clarification on ask_question tool
Remove dead clarification handling from CreateAgent and EditAgent —
both the isClarificationNeededOutput type guard and the
ClarificationQuestionsCard rendering. All clarification now goes
through the generic ask_question tool.

Update agent_generation_guide.md to allow ask_question at any point
in the workflow (not just before building), covering mid-flow
ambiguity during block discovery or JSON generation.
2026-04-02 14:04:33 +02:00
Zamil Majdy
5706c78341 fix(frontend): use normalized keywords in handleAnswers to match answer keys
The ClarificationQuestionsCard normalizes question keywords (dedup
suffixes), so answers are keyed by normalized keywords. handleAnswers
must use the same normalized questions to look up answers correctly.
2026-04-02 13:58:13 +02:00
Zamil Majdy
ffa5a5b0a7 fix(frontend): align isErrorOutput guard with parseOutput logic
Match the `"error" in output` check used in `parseOutput` so error
payloads without `type: "error"` are consistently recognized.
2026-04-02 13:50:40 +02:00
Zamil Majdy
2f50facfa9 refactor(frontend): remove re-export shim, import ClarificationQuestionsCard directly
Update CreateAgent and EditAgent to import ClarificationQuestionsCard
from the shared copilot/components/ location directly. Delete the
re-export shim to comply with no-barrel-files guideline.
2026-04-02 13:49:12 +02:00
Zamil Majdy
48b849934f fix(platform): address PR review — add tests, remove unused import, lift shared component
- Remove unused `logger` import from ask_question.py
- Add colocated ask_question_test.py with 3 tests covering options,
  no-options, and keyword-only cases
- Move ClarificationQuestionsCard to shared copilot/components/ location
  so AskQuestion imports from there instead of CreateAgent internals
2026-04-02 13:45:51 +02:00
Zamil Majdy
9678c4a86d feat(platform): add generic ask_question copilot tool
Add a generic `ask_question` tool that lets the copilot ask the user
clarifying questions via a dedicated UI card instead of plain text
(which gets collapsed into hidden reasoning). Reuses the existing
`ClarificationNeededResponse` model and `ClarificationQuestionsCard`
component.

Backend:
- New `AskQuestionTool` in `copilot/tools/ask_question.py`
- Registered in `TOOL_REGISTRY` and `ToolName` permissions literal
- Updated `agent_generation_guide.md` to reference `ask_question`

Frontend:
- Added `tool-ask_question` to `CUSTOM_TOOL_TYPES` (prevents collapse)
- New `AskQuestion/` renderer reusing `ClarificationQuestionsCard`
- Registered in `MessagePartRenderer` switch
2026-04-02 13:40:09 +02:00

Diff Content Not Available