Skip to content

feat(vla-manager): add template design assistant - #90

Open
MYRhouma wants to merge 4 commits into
feat/dashboard-failure-feedbackfrom
feat/vla-template-assistant
Open

feat(vla-manager): add template design assistant#90
MYRhouma wants to merge 4 commits into
feat/dashboard-failure-feedbackfrom
feat/vla-template-assistant

Conversation

@MYRhouma

@MYRhouma MYRhouma commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an optional VLA template design assistant to the VLA Manager. A user can describe a requirement in natural language, review a structured draft, and apply it to the existing editor. Saving and validation remain explicit user actions.

The assistant call is made by the VLA Manager API through a configurable OpenAI-compatible service. The browser never receives the API key. The endpoint validates the returned proposal against the existing TemplateNew schema and reports unavailable or malformed model responses clearly.

Included

  • POST /assistant/template
  • Structured template proposal and optional examples
  • VLA Manager assistant drawer
  • Safe apply/discard workflow
  • API and frontend tests
  • OpenAPI and Compose configuration

This PR is stacked on the dashboard work in PR #88.

Checks

  • VLA Manager API: 44 tests passed
  • VLA Manager API Ruff: passed
  • Frontend assistant tests: 3 passed
  • VLA Manager production build: passed
  • OpenAPI schema check: passed
  • Docker images for VLA Manager and VLA Manager API: built
  • Unconfigured assistant runtime: HTTP 503 Problem Details

CC @bzp99

@MYRhouma
MYRhouma force-pushed the feat/vla-template-assistant branch from 0888b8e to 33a3dea Compare September 8, 2026 01:39
@MYRhouma
MYRhouma marked this pull request as ready for review September 8, 2026 17:42
Copilot AI lite review requested due to automatic review settings September 8, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are validated, user-facing failure modes (conversation length mismatch and insufficient API conversation validation) and a misleading upstream HTTP error message that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds an optional “template design assistant” feature to VLA Manager, wiring a new API endpoint and a frontend drawer workflow that lets users request an AI-generated template draft, review it, and explicitly apply it to the editor.

Changes:

  • Adds POST /assistant/template to the VLA Manager API, including assistant client logic, config, validation, tests, and OpenAPI documentation.
  • Introduces a new frontend TemplateAssistant drawer component and “apply proposal” flow in the template editor.
  • Updates local/dev configuration and tests to support the assistant and frontend-side proposal application.
File summaries
File Description
vla-manager/src/components/TemplateEditor.vue Adds assistant entry point and applies proposals into the editor form.
vla-manager/src/components/TemplateAssistant.vue New assistant drawer UI, conversation display, and proposal apply action.
vla-manager/src/api/assistant.js Adds assistant API call + proposal-application helper + error messaging helper.
vla-manager/package.json Switches frontend package to ESM (type: module).
vla-manager-api/tests/test_assistant_routes.py Adds API tests for assistant success, validation, and failure cases.
vla-manager-api/src/vla_manager_api/main.py Registers the assistant router.
vla-manager-api/src/vla_manager_api/config.py Adds assistant service configuration fields.
vla-manager-api/src/vla_manager_api/assistant.py Implements assistant prompt/context builder + HTTP client + response parsing/validation.
vla-manager-api/src/vla_manager_api/assistant_routes.py Adds /assistant/template endpoint and request/response models.
vla-manager-api/README.md Documents new assistant endpoint and configuration.
test/template-assistant.test.mjs Adds node tests for proposal application and error message formatting.
test-env/README.md Documents enabling the assistant in the compose stack.
test-env/compose.yml Wires assistant-related env vars into the API service container.
docs/spec/vla-manager-api.yaml Adds OpenAPI paths/schemas for the assistant endpoint.
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +84 to +90
try:
with urlopen(request, timeout=cfg.ai_timeout_seconds) as response:
payload = json.loads(response.read())
except (HTTPError, URLError, TimeoutError, OSError) as exc:
raise AssistantUnavailable(
"The template assistant could not be reached."
) from exc
Comment on lines +25 to +39
class AssistantRequest(BaseModel):
model_config = _CAMEL_OPEN

message: str = Field(min_length=1, max_length=4000)
conversation: list[dict[str, str]] = Field(default_factory=list, max_length=20)
current_template: dict[str, Any] | None = None

@field_validator("message")
@classmethod
def message_must_contain_text(cls, value: str) -> str:
value = value.strip()
if not value:
raise ValueError("Message must contain text")
return value

Comment on lines +77 to +81
const response = await askTemplateAssistant({
message,
conversation: messages.value.slice(0, -1),
currentTemplate: clone(props.template)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants