Skip to content

Port gHashTag/BrowserOS:trios/agent-server/apps/server/src/lib/clients/llm/refine-prompt.ts (TypeScript, 2 functions) to - #7034

Merged
gHashTag merged 8 commits into
masterfrom
queen-5997
Oct 23, 2026
Merged

gHashTag merged 8 commits into
masterfrom
queen-5997

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #5997

Written by a bee on queen-5997 and published by tools/queen/publish.py. The branch itself is the bee's; the second commit is the coordination entry every pull request must add, which a bee has no way to know about.

1 file changed, 91 insertions(+)

🤖 Generated with Claude Code

Trinity Bee and others added 5 commits October 4, 2026 10:20
…s/llm/refine-prompt.ts to .t27

- Add buildSystemPrompt function that builds system prompt for LLM refinement
- Add refinePrompt function with undefined body (external calls are plumbing)
- Add 2 tests for buildSystemPrompt function
- Port decision logic, not plumbing as required

Closes #5997
…s/llm/refine-prompt.ts to .t27

- Port buildSystemPrompt and refinePrompt functions
- Add proper structs for RefinePromptConfig, RefinePromptRequest, RefinePromptResult
- Add 4 test cases covering both functions
- Handle optional parameters and external dependencies appropriately

Closes #5997
Port gHashTag/BrowserOS trios/agent-server/apps/server/src/lib/clients/llm/refine-prompt.ts
to specs/port/browseros/trios/agent-server/apps/server/src/lib/clients/llm/refine-prompt.t27,
the .t27 source the TypeScript is generated from.

Decision logic, not plumbing:
- buildSystemPrompt: renders the scheduled-task system prompt as three parts
  (intro, name, body) the caller joins - .t27 has no string concatenation.
  Text is the original's, em dashes and all.
- refine_prompt_verdict: trim the streamed response; empty trimmed response is
  a failure with "Provider returned an empty response"; otherwise success
  carrying the trimmed text.
- refine_prompt_error: any error becomes a failure carrying its message.
- refinePrompt: resolveLLMConfig, createLLMProvider and streamText are network,
  async, and the timeout lives in shared constants - keeps its name with an
  undefined; body that no test calls.

7 test blocks assert trim, verdict, error and system-prompt behavior from the
original. t27c typecheck: 0 errors, 0 warnings. t27c test-report: 7/7 pass.

Closes #5997
…s/llm/refine-prompt.ts to .t27

- Add buildSystemPrompt function that creates system prompt template
- Add refinePrompt function with decision logic for success/failure handling
- Include proper struct definitions for LLMConfig, RefinePromptRequest, RefinePromptResult
- Add 4 comprehensive tests covering basic functionality and edge cases
- Port the decision logic, not the plumbing (network calls, streaming)

Closes #5997
A pull request must add exactly one docs/now entry and a bee has no way
to know that: its brief names a boundary file and acceptance criteria,
and docs/now/ is neither. The publisher adds it rather than failing the
gate.

Closes #5997

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-06 18:58:49 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 50
PRs with All Checks Green 0
READY 0
FAILING 50
PENDING 0
NO CHECKS YET 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=b23641f01baa != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

This was referenced Oct 6, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-23 05:09:54 UTC

Summary

Status Count
Total Open PRs 31
PRs with Failing Checks 29
PRs with All Checks Green 2
READY 0
FAILING 29
PENDING 0
NO CHECKS YET 2

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=5aec047d42ec != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants