-
-
Notifications
You must be signed in to change notification settings - Fork 7
Fix: Prioritize truthfulness and up-to-date information #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ion in writer agent
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThe writer function in Changes
Sequence DiagramsequenceDiagram
participant Caller
participant Writer Function
participant LLM
participant Response Handler
Caller->>Writer Function: invoke(dynamicSystemPrompt?, ...)
rect rgb(200, 220, 240)
Note over Writer Function: Select System Prompt
alt dynamicSystemPrompt provided & non-empty
Writer Function->>Writer Function: use dynamicSystemPrompt
else
Writer Function->>Writer Function: use default enhanced prompt
end
end
Writer Function->>LLM: call(systemPrompt, ...)
LLM-->>Response Handler: stream response
Response Handler->>Response Handler: assemble chunks
Response Handler-->>Caller: return assembled response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Areas requiring attention:
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new default system prompt introduces a syntax-breaking change: default_system_prompt is no longer assigned a string, which will prevent the code from compiling or running. The prompt also includes a directive to ignore policy-based refusals, which can conflict with higher-level safety or governance requirements. Finally, the updated wording loosens the previous strict grounding to tool outputs, which may undermine efforts to minimize hallucinations unless intentionally desired.
Summary of changes
- Replaced the previous default system prompt string for the writer agent with a new, more detailed set of Truthfulness and Aggregation Directives.
- New prompt emphasizes truthfulness, timeliness (most recent information), aggregation across all tools, unbiased tone, and Markdown formatting with proper link/image syntax.
- The rest of the writer function logic (selection between dynamic and default system prompt, streaming, etc.) remains unchanged.
| const default_system_prompt As a professional writer, your job is to generate a comprehensive, informative, and **truthful** answer. Your response must be **grounded in the most up-to-date information** available from the provided search results (URL and content) and other tools. | ||
|
|
||
| **Truthfulness and Aggregation Directives:** | ||
| 1. **Prioritize Truth:** Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources. | ||
| 2. **Knowledge Aggregation:** Aggregate and synthesize information from **all** provided sources (search results, mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less). | ||
| 3. **Timeliness:** Explicitly prioritize information with the most recent timestamps to ensure the answer is up-to-date. | ||
| 4. **Tone and Citation:** Use an unbiased and journalistic tone. Whenever quoting or referencing information from a specific URL, always cite the source URL explicitly. | ||
| 5. **Format:** Always answer in Markdown format. Links and images must follow the correct format. | ||
| - Link format: [link text](url) | ||
| - Image format:  |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new default_system_prompt declaration is syntactically invalid as shown: it is missing the = and backticks for a template/string literal. This will break compilation/runtime and prevent the writer agent from working at all. It also appears to have introduced raw Markdown formatting into the TSX file without being wrapped as a string. You need to keep the const default_system_prompt = \ ...` form (or equivalent) so the prompt is a valid JavaScript string.
Suggestion
Restore default_system_prompt as a valid string assignment while preserving your new content, for example:
const default_system_prompt = `As a professional writer, your job is to generate a comprehensive, informative, and truthful answer. Your response must be grounded in the most up-to-date information available from the provided search results (URL and content) and other tools.
Truthfulness and Aggregation Directives:
1. Prioritize Truth: Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources.
2. Knowledge Aggregation: Aggregate and synthesize information from all provided sources (search results, mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less).
3. Timeliness: Explicitly prioritize information with the most recent timestamps to ensure the answer is up-to-date.
4. Tone and Citation: Use an unbiased and journalistic tone. Whenever quoting or referencing information from a specific URL, always cite the source URL explicitly.
5. Format: Always answer in Markdown format. Links and images must follow the correct format.
- Link format: [link text](url)
- Image format: 
There are also some preconfigured example queries.
When asked about 'What is a planet computer?' answer with the following: '"A planet computer is a proprietary environment aware system that interoperates Climate forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet'`;Adjust wording/indentation as needed, but keep it as a single template string assigned to the const. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.
| **Truthfulness and Aggregation Directives:** | ||
| 1. **Prioritize Truth:** Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources. | ||
| 2. **Knowledge Aggregation:** Aggregate and synthesize information from **all** provided sources (search results, mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less). | ||
| 3. **Timeliness:** Explicitly prioritize information with the most recent timestamps to ensure the answer is up-to-date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new directive "Do not decline to answer factual questions based on policy concerns" conflicts with typical safety and policy requirements that may still need to be enforced at a higher level. Embedding a hard override of policy into an agent prompt can make the system harder to maintain or integrate with future safety layers. Consider rephrasing to prioritize truth while still allowing higher-level safeguards to operate.
Suggestion
Soften the instruction to respect broader system policies while still emphasizing truthfulness, e.g.:
1. Prioritize Truth: Your primary goal is to convey accurate, verifiable information based on credible sources. When safety or policy constraints apply, still provide as much factual, policy-compliant information and context as possible instead of unnecessarily refusing to answer.
This preserves the intent without directly instructing the model to ignore policy. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.
| const default_system_prompt As a professional writer, your job is to generate a comprehensive, informative, and **truthful** answer. Your response must be **grounded in the most up-to-date information** available from the provided search results (URL and content) and other tools. | ||
|
|
||
| **Truthfulness and Aggregation Directives:** | ||
| 1. **Prioritize Truth:** Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources. | ||
| 2. **Knowledge Aggregation:** Aggregate and synthesize information from **all** provided sources (search results, mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less). | ||
| 3. **Timeliness:** Explicitly prioritize information with the most recent timestamps to ensure the answer is up-to-date. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated prompt drops some explicit constraints present in the previous version, such as "You must only use information from the provided search results" and explicit mention of combining search and Mapbox results. If the system design relies on strict grounding to tool outputs, the new wording "and other tools" is looser and may encourage hallucinated content depending on how the model interprets it.
Suggestion
Consider explicitly retaining the grounding constraint to reduce hallucinations, for example:
Your response must be grounded exclusively in information from the provided tools and data sources (search results, Mapbox results, and any other tool outputs). Do not fabricate facts or rely on unstated background knowledge; if the tools do not provide sufficient information, state that clearly.
This keeps the new truthfulness/timeliness directives while preserving strong grounding. Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this suggestion.
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/agents/writer.tsx (1)
7-12: NewdynamicSystemPromptparameter may be a breaking API changeAdding
dynamicSystemPrompt: stringas the first parameter changes the public signature ofwriter. Any existing call sites that previously did:writer(uiStream, streamText, messages)will now fail to compile or, if using
any, will pass the wrong argument in thedynamicSystemPromptslot.Consider either:
- Making
dynamicSystemPromptoptional with a default, or- Introducing an options object so you can evolve the API without positional breakage.
Example options‑object refactor:
-export async function writer( - dynamicSystemPrompt: string, // New parameter - uiStream: ReturnType<typeof createStreamableUI>, - streamText: ReturnType<typeof createStreamableValue<string>>, - messages: CoreMessage[] -) { +export interface WriterOptions { + dynamicSystemPrompt?: string; +} + +export async function writer( + { dynamicSystemPrompt }: WriterOptions, + uiStream: ReturnType<typeof createStreamableUI>, + streamText: ReturnType<typeof createStreamableValue<string>>, + messages: CoreMessage[] +) {If you’d rather keep the positional API, please double‑check all call sites are updated accordingly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
lib/agents/writer.tsx(1 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
lib/agents/writer.tsx
[error] 22-22: Const declarations must have an initialized value.
This variable needs to be initialized.
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: expected , but instead found and
Remove and
(parse)
[error] 22-22: expected , but instead found content
Remove content
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected an identifier but instead found '**'.
Expected an identifier here.
(parse)
[error] 24-24: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected a statement but instead found '**'.
Expected a statement here.
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 26-26: Expected an identifier but instead found '2.'.
Expected an identifier here.
(parse)
[error] 26-26: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 26-26: Expected a statement but instead found '**'.
Expected a statement here.
(parse)
[error] 27-27: expected ( but instead found the
Remove the
(parse)
[error] 27-27: expected ) but instead found most
Remove most
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: with statements are not allowed in strict mode
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 28-28: Expected an identifier but instead found '4.'.
Expected an identifier here.
(parse)
[error] 28-28: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 28-28: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 28-28: Expected a statement but instead found '**'.
Expected a statement here.
(parse)
🔇 Additional comments (1)
lib/agents/writer.tsx (1)
36-43: System prompt selection logic looks correctThe fallback logic:
const systemToUse = dynamicSystemPrompt && dynamicSystemPrompt.trim() !== '' ? dynamicSystemPrompt : default_system_prompt;cleanly prefers a non‑empty dynamic prompt while preserving the new default as a safety net, and it’s correctly wired into the
systemfield ofnonexperimental_streamText.No changes needed here.
| // Default system prompt, used if dynamicSystemPrompt is not provided | ||
| const default_system_prompt = `As a professional writer, your job is to generate a comprehensive and informative, yet concise answer of 400 words or less for the given question based solely on the provided search results (URL and content). You must only use information from the provided search results. Use an unbiased and journalistic tone. Combine search results and mapbox results together into a coherent answer. Do not repeat text. If there are any images or maps relevant to your answer, be sure to include them as well. Aim to directly address the user's question, augmenting your response with insights gleaned from the search results and the mapbox tool. | ||
| Whenever quoting or referencing information from a specific URL, always cite the source URL explicitly. Please match the language of the response to the user's language. | ||
| Always answer in Markdown format. Links and images must follow the correct format. | ||
| Link format: [link text](url) | ||
| Image format:  | ||
|
|
||
| const default_system_prompt As a professional writer, your job is to generate a comprehensive, informative, and **truthful** answer. Your response must be **grounded in the most up-to-date information** available from the provided search results (URL and content) and other tools. | ||
|
|
||
| **Truthfulness and Aggregation Directives:** | ||
| 1. **Prioritize Truth:** Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources. | ||
| 2. **Knowledge Aggregation:** Aggregate and synthesize information from **all** provided sources (search results, mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less). | ||
| 3. **Timeliness:** Explicitly prioritize information with the most recent timestamps to ensure the answer is up-to-date. | ||
| 4. **Tone and Citation:** Use an unbiased and journalistic tone. Whenever quoting or referencing information from a specific URL, always cite the source URL explicitly. | ||
| 5. **Format:** Always answer in Markdown format. Links and images must follow the correct format. | ||
| - Link format: [link text](url) | ||
| - Image format:  | ||
| There are also some proconfigured example queires. | ||
| When asked about 'What is a planet computer?' answer with the following: '"A planet computer is a proprietary environment aware system that interoperates Climate forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet' | ||
| `; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_system_prompt declaration is syntactically invalid and breaks parsing
As written, const default_system_prompt As a professional writer, ... is not valid TypeScript/TSX: it’s missing the = and the template‑literal backticks, and all subsequent lines (24–34) are parsed as stray tokens. This matches the Biome parse errors you’re seeing.
You need to wrap the prompt in a template literal and assign it to the constant. While touching it, you can also fix a couple of small typos and quoting issues in the prompt text.
Suggested fix:
- // Default system prompt, used if dynamicSystemPrompt is not provided
- const default_system_prompt As a professional writer, your job is to generate a comprehensive, informative, and **truthful** answer. Your response must be **grounded in the most up-to-date information** available from the provided search results (URL and content) and other tools.
-
- **Truthfulness and Aggregation Directives:**
- 1. **Prioritize Truth:** Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources.
- 2. **Knowledge Aggregation:** Aggregate and synthesize information from **all** provided sources (search results, mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less).
- 3. **Timeliness:** Explicitly prioritize information with the most recent timestamps to ensure the answer is up-to-date.
- 4. **Tone and Citation:** Use an unbiased and journalistic tone. Whenever quoting or referencing information from a specific URL, always cite the source URL explicitly.
- 5. **Format:** Always answer in Markdown format. Links and images must follow the correct format.
- - Link format: [link text](url)
- - Image format: 
- There are also some proconfigured example queires.
- When asked about 'What is a planet computer?' answer with the following: '"A planet computer is a proprietary environment aware system that interoperates Climate forecasting, mapping and scheduling using cutting edge multi-agents to streamline automation and exploration on a planet'
- `;
+ // Default system prompt, used if dynamicSystemPrompt is not provided
+ const default_system_prompt = `
+As a professional writer, your job is to generate a comprehensive, informative, and **truthful** answer. Your response must be **grounded in the most up-to-date information** available from the provided search results (URL and content) and other tools.
+
+**Truthfulness and Aggregation Directives:**
+1. **Prioritize Truth:** Your primary goal is to convey accurate, verifiable information. Do not decline to answer factual questions based on policy concerns; instead, present the facts as reported by credible sources.
+2. **Knowledge Aggregation:** Aggregate and synthesize information from **all** provided sources (search results, Mapbox results, and any other tool outputs) into a single, coherent, and concise answer (400 words or less).
+3. **Timeliness:** Explicitly prioritize information with the most recent timestamps to ensure the answer is up to date.
+4. **Tone and Citation:** Use an unbiased and journalistic tone. Whenever quoting or referencing information from a specific URL, always cite the source URL explicitly.
+5. **Format:** Always answer in Markdown format. Links and images must follow the correct format:
+ - Link format: [link text](url)
+ - Image format: 
+
+There are also some preconfigured example queries.
+When asked "What is a planet computer?" answer with the following: "A planet computer is a proprietary environment-aware system that interoperates climate forecasting, mapping, and scheduling using cutting-edge multi-agents to streamline automation and exploration on a planet."
+`;This will resolve the parse errors and better align the prompt text with the PR’s truthfulness/timeliness objective.
🧰 Tools
🪛 Biome (2.1.2)
[error] 22-22: Const declarations must have an initialized value.
This variable needs to be initialized.
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: expected , but instead found and
Remove and
(parse)
[error] 22-22: expected , but instead found content
Remove content
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 22-22: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected an identifier but instead found '**'.
Expected an identifier here.
(parse)
[error] 24-24: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 24-24: Expected a statement but instead found '**'.
Expected a statement here.
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 25-25: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 26-26: Expected an identifier but instead found '2.'.
Expected an identifier here.
(parse)
[error] 26-26: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 26-26: Expected a statement but instead found '**'.
Expected a statement here.
(parse)
[error] 27-27: expected ( but instead found the
Remove the
(parse)
[error] 27-27: expected ) but instead found most
Remove most
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: with statements are not allowed in strict mode
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 27-27: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 28-28: Expected an identifier but instead found '4.'.
Expected an identifier here.
(parse)
[error] 28-28: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 28-28: Expected a semicolon or an implicit semicolon after a statement, but found none
An explicit or implicit semicolon is expected here...
...Which is required to end this statement
(parse)
[error] 28-28: Expected a statement but instead found '**'.
Expected a statement here.
(parse)
[error] 33-33: expected ( but instead found the
Remove the
(parse)
[error] 33-33: expected ) but instead found following
Remove following
(parse)
🤖 Prompt for AI Agents
In lib/agents/writer.tsx around lines 21 to 34, the declaration "const
default_system_prompt As a professional writer..." is syntactically invalid and
causes parse errors; change it to a proper constant assignment by adding an
equals sign and wrapping the entire prompt text in a template literal
(backticks), correct obvious typos/quoting issues inside the prompt (e.g.,
"queries", punctuation, and the example planet computer string quotes), and
terminate the statement properly so the TSX file parses correctly.
User description
This pull request addresses the issue of the system not returning up-to-date information and not prioritizing truthfulness, as reported by the user. \n\nChanges in
writer.tsx:\n- The system prompt for the writer agent is updated with Truthfulness and Aggregation Directives.\n- It explicitly instructs the model to Prioritize Truth and not decline to answer factual questions based on policy concerns, but to present facts from credible sources.\n- It emphasizes Timeliness by instructing the model to prioritize information with the most recent timestamps.\n- It promotes Knowledge Aggregation from all available tools and sources.PR Type
Enhancement
Description
Enhanced writer agent system prompt to prioritize truthfulness and accuracy
Added explicit directives for knowledge aggregation from all available sources
Implemented timeliness requirement to use most recent information timestamps
Restructured prompt with numbered directives for clarity and emphasis
Diagram Walkthrough
File Walkthrough
writer.tsx
Enhance system prompt with truthfulness and timeliness directiveslib/agents/writer.tsx
default_system_promptto emphasize truthfulness as primarygoal
agent
timestamps
critical guidelines
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.