Skip to content

feat: implement Phase 1 AI Work Panel for document modification (#274) - #277

Merged
petertzy merged 4 commits into
petertzy:mainfrom
CoDe-ReDz:feature/ai-work-panel-274
Sep 28, 2026
Merged

petertzy merged 4 commits into
petertzy:mainfrom
CoDe-ReDz:feature/ai-work-panel-274

Conversation

@CoDe-ReDz

@CoDe-ReDz CoDe-ReDz commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR implements Phase 1 of the Feasibility Study for the AI Work Panel, allowing users to communicate with AI in natural language to directly modify the currently active editor tab.

Closes #274

Tasks Completed

  • Backend: Added a /work endpoint in routers/ai.py and a dedicated process_document_work LLM prompt in ai_logic.py designed to output strictly raw Markdown without conversational filler.
  • Frontend State: Extended useAIActions.ts with an executeWork method that sends the current document context to the backend and applies the returned Markdown directly to the editor.
  • Frontend UI: Added a new "Work" tab to the AIPanel.tsx component to handle natural language instructions and trigger document modifications.

Acceptance Criteria Met

  • Conversations in the Work panel provide the AI with the necessary context from the currently active document.
  • When the user requests a change, the AI attempts to apply appropriate modifications to that document rather than merely explaining what the user should change manually.
  • The architecture leaves room for expanding from operations on a single document to project-wide operations in the future.

Demo

Image1 Image2

@petertzy

Copy link
Copy Markdown
Owner

I reviewed the implementation against the PR description and the acceptance criteria for Phase 1 of the AI Work Panel.

The backend /api/ai/work endpoint correctly receives the instruction and current document content, processes the request through the configured AI provider, and returns modified Markdown. The frontend Work tab sends the active document context and applies the returned Markdown directly to the editor. The implementation is also structured in a way that can be extended to support broader project-level operations in the future.

During testing, I found an issue where the Work endpoint sent temperature: 0.2. Some configured models only support the default temperature value of 1, which caused requests such as “fix all typos” to fail with HTTP 400. This issue has been fixed by removing the unsupported custom temperature parameter from Work requests.

The fix has been verified with backend compilation and Ruff checks. The current PR now satisfies the stated Phase 1 requirements and is ready to be merged into the main branch.

@petertzy
petertzy merged commit 3d97f19 into petertzy:main Sep 28, 2026
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.

Feasibility Study: AI Work Panel and Future Project Direction

2 participants