Skip to content

Conversation

@songhahaha66
Copy link
Owner

No description provided.

@vercel
Copy link

vercel bot commented Nov 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
paper-agent Ready Ready Preview Comment Dec 1, 2025 4:30am

@songhahaha66 songhahaha66 marked this pull request as draft November 29, 2025 16:23
- Add output_mode column to works table with migration (906ca23fbfe1)
- Support markdown, word, and latex output formats
- Update Work model to include output_mode field with markdown as default
- Add output_mode to WorkCreate schema with default value
- Add output_mode to WorkUpdate schema as optional field
- Add output_mode to WorkResponse schema for API responses
- Enable flexible document export functionality for different output formats
…tion

- Add output_mode parameter to MainAgent supporting "markdown", "word", and "latex" modes
- Implement WordToolWrapper in core_managers for Word document operations via MCP
- Add async word tools loading with fallback logic to markdown mode
- Create new MCP routes module with mcp_status endpoint for service health checks
- Integrate MCP manager initialization in main application startup
- Update system prompts dynamically based on selected output mode with mode-specific instructions
- Add Word-specific tools: word_create_document, word_add_heading, word_add_paragraph, word_add_table, word_add_picture, word_save_document
- Enhance workspace file services to support Word document generation and management
- Update chat routes to pass output_mode and mcp_manager to MainAgent initialization
- Add frontend support for output mode selection in Work.vue and Home.vue
- Implement graceful degradation with automatic fallback when MCP service unavailable or LaTeX mode requested
- Add comprehensive error handling and user notifications for mode initialization failures
…angChain integration

- Move word_tools.py from core_managers to core_tools directory for better organization
- Remove MCP manager dependency from MainAgent initialization and Word tool loading
- Simplify Word tool loading by directly using LangChainToolFactory instead of WordToolWrapper
- Eliminate async MCP availability checks and replace with direct tool creation
- Remove word_save_document from system prompt as documents now auto-save
- Update system prompt to reflect simplified Word tool workflow and auto-save behavior
- Remove MCPClientManager from core_managers exports
- Update pyproject.toml and uv.lock dependencies
- Streamline error handling and fallback logic for Word mode initialization
- Consolidate LaTeX and Word mode handling in _load_word_tools method
…ging

- Add LLM capability detection for bind_tools method support
- Log LLM type, model name, and model_kwargs for debugging
- Add tool binding test to verify tool invocation compatibility
- Include system prompt and debug mode in agent creation
- Add detailed logging of registered tools at initialization
- Enhance system prompt to emphasize mandatory tool usage
- Add comprehensive message logging in agent invocation flow
- Track and log tool calls count and details from agent responses
- Add warning when no tool calls are detected in agent output
- Improve debugging visibility for tool invocation issues and agent behavior
…pts for Word/Markdown workflows

- Add conditional tool loading based on output_mode (Word vs Markdown)
* Word mode loads only base tools without Markdown-specific tools
* Markdown mode loads all tools including writemd
- Restructure system prompt with clearer behavioral guidelines and task delegation
* Add explicit instructions for proactive content generation without asking users
* Clarify MainAgent vs CodeAgent responsibility separation
* Emphasize Word document operations must use word_* tools, never CodeAgent
- Enhance Word mode workflow documentation
* Document that paper.docx already exists in workspace
* Add step-by-step Word tool usage instructions
* Clarify task distribution: MainAgent handles document creation, CodeAgent handles programming
- Add strict prohibitions against CodeAgent manipulating Word documents
* Prevent misuse of python-docx in CodeAgent
* Ensure all Word operations go through dedicated word_* tools
- Improve task completion criteria
* Require actual file output (paper.docx or paper.md) not just conversation responses
* Add confirmation step after file generation
- Refactor tool factory to support output-mode-specific tool creation
* Create create_base_tools method for Word mode
* Maintain create_all_tools for Markdown mode
…gation

- Add WriterAgent class to handle all document writing tasks independently
- Create writer_agent_execute tool in LangChainToolFactory for delegating document operations
- Refactor MainAgent to delegate document operations to WriterAgent instead of direct tool calls
- Remove output_mode-based tool loading logic from MainAgent initialization
- Remove _load_word_tools async method and related Word tool management code
- Update MainAgent system prompt to instruct delegation of all document tasks to WriterAgent
- Update core_agents __
…rAgent

- Add writer_llm parameter to MainAgent initialization for dedicated WriterAgent LLM instance
- Update LangChainToolFactory to accept and prioritize writer_llm over fallback llm
- Implement writer LLM configuration loading from "writing" config in chat routes
- Add logic to use dedicated writer LLM if available, otherwise fall back to main LLM
- Add comprehensive logging to indicate which LLM instance is being used by WriterAgent
- Add "writing" model configuration section to frontend ApiKeyConfig for user setup
- Enables users to configure separate LLM models for document writing operations while maintaining backward compatibility
…omous content creation

- Update MainAgent system prompt to emphasize high-level objectives over specific instructions
- Clarify task delegation: MainAgent provides strategic goals, WriterAgent handles autonomous content creation
- Add explicit examples of correct (high-level) vs incorrect (overly specific) instructions for both Word and Markdown modes
- Enhance WriterAgent system prompt to emphasize professional academic writing and autonomous decision-making
- Restructure workflow documentation to highlight content creation autonomy rather than tool-specific instructions
- Improve role separation between MainAgent (planning), WriterAgent (creation), and CodeAgent (computation)
- Add visual indicators (✅/❌) to distinguish proper vs improper instruction patterns
- Clarify that WriterAgent should determine specific content, formatting, and tool selection independently
- Add output_format field to template form submission payload
- Include output_format when saving template data to backend
- Enable template output format configuration during creation
- Align with existing output mode support across the application
- Add logo image display next to PaperAgent title in login header
- Create new `.title-with-logo` container with flexbox layout for logo and title alignment
- Style logo with 40x40px dimensions and proper object-fit
- Adjust h1 margin and line-height for better visual alignment with logo
- Add 12px gap between logo and title for proper spacing
- Improve visual branding and user experience on login page
…llapse feature

- Remove result length metadata from agent completion notifications in BaseAgent, CodeAgent, and MainAgent
- Send actual output content instead of length summaries for better user feedback
- Skip word_tool_result notifications in WordTools to reduce notification noise
- Add collapsible JSON blocks in JsonChatRenderer with expand/collapse toggle functionality
- Implement content preview for collapsed blocks (first 100 characters with ellipsis)
- Add visual styling for word tool notifications (word_tool_call, word_tool_result, word_tool_error)
- Improve UX by allowing users to collapse verbose JSON block outputs while maintaining preview visibility
- Add overflow hidden and box-sizing border-box to container for proper containment
- Change file-info alignment from center to flex-start for better vertical spacing
- Add 16px gap between file-info elements for improved spacing
- Update file-header alignment to flex-start with flex: 1 and min-width: 0 for text truncation
- Reduce file-header gap from 16px to 12px for tighter icon spacing
- Add 2px margin-top to file-icon for visual alignment adjustment
- Add min-width: 0 to file-details to enable proper text overflow handling
- Add align-self: flex-start to file-actions for consistent top alignment
- Ensures proper text truncation and prevents layout overflow issues
…dTool definitions

- Remove manual args_schema definitions from writemd tool configuration
- Remove manual args_schema definitions from update_template tool configuration
- Remove manual args_schema definitions from tree tool configuration
- Remove manual args_schema definitions from template section management tools (get_section_content, update_section_content, add_section, rename_section_title)
- Rely on LangChain's automatic schema inference from function signatures instead of explicit schema definitions
- Simplify tool definitions by removing redundant schema specifications while maintaining description clarity
- Reduce code duplication and improve maintainability across multiple tool factory methods
…te Dockerfile

- Remove PA_DATA_PATH_CONFIG.md documentation file as path configuration is now established
- Add office_word_mcp workspace member to Docker build context
- Update Dockerfile COPY instruction to include local workspace dependencies
- Simplify documentation by removing outdated path configuration guide
@songhahaha66 songhahaha66 changed the title [WIP] feat(word):Add Word support for PaperAgent feat(word):Add Word support for PaperAgent Dec 1, 2025
@songhahaha66 songhahaha66 marked this pull request as ready for review December 1, 2025 05:16
@songhahaha66 songhahaha66 merged commit e3c04ff into master Dec 1, 2025
3 checks passed
@songhahaha66 songhahaha66 deleted the word-support branch December 1, 2025 05:39
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