Skip to content

Prospecting run controls and guided intake - #37

Open
yudelevi wants to merge 8 commits into
developmentfrom
feat/prospecting-run-controls-and-intake
Open

yudelevi wants to merge 8 commits into
developmentfrom
feat/prospecting-run-controls-and-intake

Conversation

@yudelevi

@yudelevi yudelevi commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Managed prospecting now lets a caller tune the plan before approval and answer the intake card, both live on the API.

  • Run controls: prospecting.update_plan (PATCH /prospecting/runs/{id}/plan) sets engines, search provider and a max_spend_usd spending limit; candidate_limit and credit_limit stop reasons.
  • Intake: prospecting.answer_intake with IntakeAnswer; ProspectingMessageRequest.text is optional so a message can carry intake alone.
  • Request models regenerated from the dev spec; contract check clean (added ProspectingInFlight.progress).

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with non-blocking request-validation and contract-coverage improvements recommended.

Fix All in Claude CodeFindings

  1. P2 Empty messages pass validation ▶
  2. P2 Intake route loses contract coverage ▶
Fix with agent prompt
### Issue 1
packages/discolike/src/discolike/_generated/requests.py:3249-3250
Both `text` and `intake` are optional, so `ProspectingMessageRequest()` passes validation and `message()` sends `{}`. Previously, a missing message was rejected locally. This now makes an unnecessary API request and leaves the server to reject it. Please require at least one field and test that case.

### Issue 2
packages/discolike/src/discolike/resources/prospecting.py:227
`answer_intake` declares the same POST route as `message`. Route discovery keeps only the first method for a given method and path, so it skips `answer_intake` during the contract check. That leaves this new method without its own contract coverage. Please avoid declaring the wrapper as a separate route, or account for it explicitly in route discovery.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR adds sync and async controls for updating a proposed prospecting plan and answering guided intake, along with request models, documentation, and tests.

  • The message model now permits an empty request.
  • The new intake convenience method is omitted from route-based contract discovery because it duplicates the message route.

Reviews (1) · Last reviewed commit: "Regenerate request models from the dev s..."

Managed prospecting runs now let a caller pick contact, company-check
and search engines and a credit limit on a proposed plan, and report
candidate_limit and credit_limit stop reasons. The request model is
hand-added in generated form until the deployed spec carries it.
The API now prices a run's limit at the plan's per-record rate, so the
plan settings take max_spend_usd in place of max_credits.
The API keeps the limit in run state, so run briefs never carry it;
only the plan settings take max_spend_usd.
Runs can now ask a short option card before planning. answer_intake
posts the picked values / free text per question key through the
existing messages route, so older SDKs and servers are unaffected.
ProspectingMessageRequest.text becomes optional.
Comment on lines +3249 to +3250
class ProspectingMessageRequest(DiscolikeRequest):
text: Annotated[str | None, Field(max_length=4000, min_length=1, title="Text")] = None

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Empty messages pass validation

Both text and intake are optional, so ProspectingMessageRequest() passes validation and message() sends {}. Previously, a missing message was rejected locally. This now makes an unnecessary API request and leaves the server to reject it. Please require at least one field and test that case.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/discolike/src/discolike/_generated/requests.py
Line: 3249-3250

Comment:
**Empty messages pass validation**

Both `text` and `intake` are optional, so `ProspectingMessageRequest()` passes validation and `message()` sends `{}`. Previously, a missing message was rejected locally. This now makes an unnecessary API request and leaves the server to reject it. Please require at least one field and test that case.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

@@ -214,6 +225,18 @@ def message(
)
return ProspectingMessage.model_validate(response.json())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Intake route loses contract coverage

answer_intake declares the same POST route as message. Route discovery keeps only the first method for a given method and path, so it skips answer_intake during the contract check. That leaves this new method without its own contract coverage. Please avoid declaring the wrapper as a separate route, or account for it explicitly in route discovery.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/discolike/src/discolike/resources/prospecting.py
Line: 227

Comment:
**Intake route loses contract coverage**

`answer_intake` declares the same POST route as `message`. Route discovery keeps only the first method for a given method and path, so it skips `answer_intake` during the contract check. That leaves this new method without its own contract coverage. Please avoid declaring the wrapper as a separate route, or account for it explicitly in route discovery.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Codex

This branch has not been deployed

No deployments
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.

1 participant