Skip to content

centralize prompt #548

Merged
sng-asyncfunc merged 2 commits into
AsyncFuncAI:mainfrom
GdoongMathew:refactor/centralize_prompt
Jul 19, 2026
Merged

centralize prompt #548
sng-asyncfunc merged 2 commits into
AsyncFuncAI:mainfrom
GdoongMathew:refactor/centralize_prompt

Conversation

@GdoongMathew

@GdoongMathew GdoongMathew commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Reuse the centralized prompt variable in prompt.py. (related to #306)

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors api/websocket_wiki.py by externalizing the large, hardcoded system prompts into a separate module api/prompts.py and formatting them dynamically. Feedback on these changes highlights two issues: first, passing research_iteration to DEEP_RESEARCH_FINAL_ITERATION_PROMPT is redundant as the template lacks this placeholder; second, DEEP_RESEARCH_INTERMEDIATE_ITERATION_PROMPT in api/prompts.py uses double curly braces for research_iteration, which escapes the formatting and prevents the actual iteration number from being rendered.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread api/websocket_wiki.py
Comment on lines +281 to +287
system_prompt = DEEP_RESEARCH_FINAL_ITERATION_PROMPT.format(
repo_type=repo_type,
repo_url=repo_url,
repo_name=repo_name,
research_iteration=research_iteration,
language_name=language_name
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The DEEP_RESEARCH_FINAL_ITERATION_PROMPT template in api/prompts.py does not contain a {research_iteration} placeholder. Passing research_iteration to .format() here is redundant and can be removed to keep the code clean.

                system_prompt = DEEP_RESEARCH_FINAL_ITERATION_PROMPT.format(
                    repo_type=repo_type,
                    repo_url=repo_url,
                    repo_name=repo_name,
                    language_name=language_name
                )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in 075fbd5

Comment thread api/websocket_wiki.py
Comment on lines +289 to +295
system_prompt = DEEP_RESEARCH_INTERMEDIATE_ITERATION_PROMPT.format(
repo_type=repo_type,
repo_url=repo_url,
repo_name=repo_name,
research_iteration=research_iteration,
language_name=language_name
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

There is an issue with how DEEP_RESEARCH_INTERMEDIATE_ITERATION_PROMPT is defined in api/prompts.py. On line 134 of api/prompts.py, it uses double curly braces: ## Research Update {{research_iteration}}. Because of the double curly braces, calling .format(research_iteration=research_iteration) here will escape them and output the literal string ## Research Update {research_iteration} to the LLM instead of the actual iteration number. Please update api/prompts.py to use single curly braces {research_iteration} on line 134.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed in 075fbd5

@sng-asyncfunc
sng-asyncfunc merged commit b84c0b2 into AsyncFuncAI:main Jul 19, 2026
3 checks passed
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