-
Notifications
You must be signed in to change notification settings - Fork 0
fix: restore manager source flow and add safe hire recovery #12
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dc2e327
fix: restore manager source flow and add safe hire recovery
dfed25 184ab9a
fix: auto-sync new sources and relax scoped retrieval threshold
dfed25 64d7d68
Fix hire chat retrieval: strict hire scope, backoff search, keyword f…
dfed25 066a4cf
Hire retrieval: merge vector + title keyword hits and rerank so named…
dfed25 2797384
Ingest Google Drive folder/file URLs via Drive API for hire sync (not…
dfed25 97851cc
Chat: structured markdown-style answers in prompt; readable UI (headi…
dfed25 85683eb
Merge branch 'main' into feature/fix-manager-sources-and-hire-safety
dfed25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| import { Fragment, type ReactNode } from "react"; | ||
|
|
||
| function formatInline(text: string): ReactNode[] { | ||
| const parts = text.split(/(\*\*[^*]+\*\*)/g); | ||
| return parts.map((part, i) => { | ||
| const m = part.match(/^\*\*(.+)\*\*$/); | ||
| if (m) { | ||
| return ( | ||
| <strong key={i} className="font-semibold text-slate-50"> | ||
| {m[1]} | ||
| </strong> | ||
| ); | ||
| } | ||
| return part ? <span key={i}>{part}</span> : null; | ||
| }); | ||
| } | ||
|
|
||
| function isBulletLine(line: string): boolean { | ||
| return /^\s*[-*]\s+/.test(line) || /^\s*\d+\.\s+/.test(line); | ||
| } | ||
|
|
||
| function stripBulletPrefix(line: string): string { | ||
| return line.replace(/^\s*[-*]\s+/, "").replace(/^\s*\d+\.\s+/, ""); | ||
| } | ||
|
|
||
| /** | ||
| * Renders assistant chat with readable structure (markdown-lite from the model). | ||
| * User messages stay plain. | ||
| */ | ||
| export function ChatMessageBody({ role, text }: { role: "user" | "assistant"; text: string }) { | ||
| if (role === "user") { | ||
| return <span className="whitespace-pre-wrap break-words">{text}</span>; | ||
| } | ||
|
|
||
| const blocks = text.trim().split(/\n\n+/).filter((b) => b.trim()); | ||
| if (blocks.length === 0) { | ||
| return <span className="text-slate-500">—</span>; | ||
| } | ||
|
|
||
| return ( | ||
| <div className="max-w-none space-y-4 text-left text-sm leading-relaxed"> | ||
| {blocks.map((block, bi) => { | ||
| const lines = block.split("\n"); | ||
| const first = lines[0]?.trim() ?? ""; | ||
|
|
||
| if (first.startsWith("## ")) { | ||
| const title = first.replace(/^##\s+/, ""); | ||
| const rest = lines | ||
| .slice(1) | ||
| .join("\n") | ||
| .trim(); | ||
| return ( | ||
| <div key={bi} className="space-y-2 border-b border-slate-700/60 pb-3 last:border-0 last:pb-0"> | ||
| <h4 className="text-[13px] font-semibold tracking-wide text-cyan-200">{formatInline(title)}</h4> | ||
| {rest ? ( | ||
| <p className="whitespace-pre-wrap break-words text-slate-200">{formatInline(rest)}</p> | ||
| ) : null} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| const nonEmpty = lines.filter((l) => l.trim()); | ||
| const allBullets = nonEmpty.length > 0 && nonEmpty.every((l) => isBulletLine(l)); | ||
| if (allBullets) { | ||
| return ( | ||
| <ul | ||
| key={bi} | ||
| className="list-disc space-y-2 pl-5 text-slate-200 marker:text-cyan-400 [&>li]:pl-1" | ||
| > | ||
| {nonEmpty.map((line, li) => ( | ||
| <li key={li} className="whitespace-pre-wrap break-words pl-0.5"> | ||
| {formatInline(stripBulletPrefix(line))} | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| ); | ||
| } | ||
|
|
||
| return ( | ||
| <p key={bi} className="whitespace-pre-wrap break-words text-slate-200"> | ||
| {lines.map((line, li) => ( | ||
| <Fragment key={li}> | ||
| {li > 0 ? <br /> : null} | ||
| {formatInline(line)} | ||
| </Fragment> | ||
| ))} | ||
| </p> | ||
| ); | ||
| })} | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Permissive default + missing trailing newline.
Two small things:
RUNBOOK_ALLOW_UNAUTH_HIRE_ACCESS=true, which is the unsafe configuration. Consider shipping.env.examplewithfalseso the principle of least surprise is "this needs auth unless you opt out for demo." (Root-cause concern lives insrc/lib/apiAuth.ts.)🛡️ Suggested change
📝 Committable suggestion
🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 16-16: [EndingBlankLine] No blank line at the end of the file
(EndingBlankLine)
🤖 Prompt for AI Agents