Skip to content

Prospecting runs: saved_query_ids and chat_closed - #36

Open
yudelevi wants to merge 13 commits into
developmentfrom
feat/agentic-prospecting
Open

yudelevi wants to merge 13 commits into
developmentfrom
feat/agentic-prospecting

Conversation

@yudelevi

@yudelevi yudelevi commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds saved_query_ids (every saved contact list part, in order) and chat_closed to ProspectingRun, and documents the misuse stop reason. Matches discolike-platform !908; merge when that ships. The contract check stays red for prospecting until the endpoints are deployed.

  • Checkpoints: document/support the checkpoints setting (ask/auto) and how to answer a check-in; auto runs sharpen a weak pilot once and keep going.

Large runs now split their saved contact list into parts instead of
truncating at 50 MiB (platform commit 2fbd2d6e5). saved_query_ids
carries all of them in order, with saved_query_id staying the first
entry for backward compatibility.
A chat closed for off-topic use cancels an unapproved or paused run
with stop_reason "misuse" while an approved queued or running one
keeps working. Callers need chat_closed on the run model to know
when to stop chatting and start a new conversation. The API's 403
on a start past the daily new-chat limit already surfaces cleanly
through the existing detail-message extraction, so no client change
was needed there.
Comment thread scripts/check_contract.py
Comment thread packages/discolike/src/discolike/resources/prospecting.py
…pes in the contract script

A key with a newline passed local validation and only failed later when the
transport built the Idempotency-Key header. check_models() also compared
schema property names only, so a type or requiredness change on a mirrored
model (e.g. saved_query_ids, chat_closed) would pass silently.
The platform's GET /prospecting/runs now accepts before (a run ID) to
page past a full page of results, ordered by created_at then run_id
descending. Forward it through the SDK and CLI so callers can walk
past the 50-row max instead of only ever seeing the newest page.
Prospecting runs can now pause at decision points (a pilot check on
large lists, a search drifting off target, running short, reaching the
target) and ask the user, or decide on their own in auto mode. The API
defaults to auto so unattended callers never stall; the web chat
defaults to asking, and the CLI is a person at a terminal, so it
follows the chat rather than the API.

The brief's checkpoints field is hidden from the platform's OpenAPI
schema to keep the MCP tool listing small, so the request generator
pins it by hand and the contract check allows it instead of flagging
drift. Approval's field is pending until the platform deploys it.

At a checkpoint, `prospecting wait` asks on a terminal and keeps
waiting. Scripts and agents get a distinct exit code 7 with the
question and suggested replies on stderr, so they can answer through
`prospecting message` without parsing prose or mistaking a pause for
success.
… list id

The platform declares prospecting status, kind, role and stage as named
type aliases, which its OpenAPI spec emits as $ref schemas. The contract
check read every $ref as "object", so all four fields reported drift on
models that actually matched. It now follows the ref to the target's
type, so a genuine type change behind a ref is still caught.

Runs gain companies_saved_query_id. The spec marks it required, but the
SDK defaults it to None so it still parses servers from before the
field existed; the contract check allows that one difference instead of
failing on it.
The owner changed the rule: a poor pilot in auto mode now sharpens the
criteria once and keeps the run going with a notice, instead of
stopping outright. pilot_failed is now reserved for a re-pilot fit
still under 20% (the searches are broken); a failed sharpening attempt
falls back to the original criteria and continues.

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