Skip to content

feat: edit a deployed agent, and show what Slack actually granted (CMP-77) - #109

Merged
ripgrim merged 87 commits into
trycompai:mainfrom
ripgrim:rg/chat-send-feedback
Aug 11, 2026
Merged

ripgrim merged 87 commits into
trycompai:mainfrom
ripgrim:rg/chat-send-feedback

Conversation

@ripgrim

@ripgrim ripgrim commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What this does

A deployed agent is editable. You can change the Slack channel it lives in, turn its actions on and off, and narrow what it reads. A change writes a new version, moves the triggers onto it, and leaves the old version in the history.

The Slack page tells the truth. It shows the scopes the workspace actually granted, names the connected workspace, and says when Comp AI is not reading Slack rather than going quiet. A private channel needs a real invite, and the page says who has to send it.

The agent has a code view. Files render with @pierre/diffs inside the page, with a diff against the previous revision. A save writes a revision per file, in order, so no edit is lost.

Runs open in a drawer with a run timeline, and a failed run can be retried.

Why it is large

It is one feature area — team agents and the Slack connection they depend on — plus the review fixes on top. Later features go in their own pull requests.

Risk

  • Adds slackInstallation, two cancellation columns on agentRun, an indexed agentTask.subject, and slackChannel.classifiedAt. Prisma generated the migration; none of it is hand-written.
  • contactEnrichmentRequested is now contactCreated, matching main.
  • Integration tests need TEST_DATABASE_URL. Run bun run db:test first.

ripgrim added 20 commits August 10, 2026 03:22
Records the connections design rules, the build prompt for the eight Paper
frames, and three investigated fix specs: builder conversation state, agent
external actions, and the Slack workspace connection.
The composer previously waited for the submit mutation and a refetch before
anything appeared, so sending a message looked like nothing had happened.

Render the submission optimistically, reconciled against the server by
clientRequestId, and show a shared ThinkingIndicator until the model responds.
The indicator also covers ordinary chat turns, which previously rendered
nothing while working because only agent builds had a progress card.
…mary

An agent whose manifest omitted run.summary could not run at all: the
manifest failed to parse, and every run died reporting an unreadable
manifest. Two of three live agents were affected. run.summary is a run's
own bookkeeping rather than an external side effect, so nothing needs to
declare it.

An event agent that legitimately has nothing to do was also marked FAILED,
because every declared action was required to have been performed. Runs can
now report noActionNeeded with a reason, which settles them as a success and
records why. Only an attempted-and-failed action fails a run.

Hide Run now on agents whose only enabled triggers are events: a manual run
carries no event payload, so it can never do anything useful.
drainAll is wrapped in collapsing(), which returns the in-flight promise to
every later caller. A rejection was already safe, but a sweep that never
settled left active set forever, so every subsequent poke was silently
swallowed and the queue simply stopped draining. A poke still answered 202,
so nothing looked wrong.

Give a sweep a deadline so it is abandoned and the next one can start, and
expose GET /internal/crm/dispatch-health reporting whether a sweep is
running, how long it has stalled, how many were abandoned, and how many
tasks are overdue. It answers 503 when wedged or backed up, so a self-hoster
can alert on it.

Tests cover both halves: a hung sweep swallows later calls, and a deadlined
one lets the next through.
A failed run showed only 'Run failed'. The reason existed on the row but was
never rendered, so the only way to learn why was to read the database.

Show the reason on the run itself, in plain language, mapped from the error
code. A non-technical reader now sees what happened and what to do next.

Move thirteen timing and batching constants out of five files into one
dispatch-config module, so a timeout can be tuned without knowing which file
declared it.

Add two AGENTS.md rules: report every issue in an ASD-STE100 list rather than
in prose, and keep tunable constants in one config module per area.
A run with a session had no execution deadline. It stayed RUNNING until
something else noticed, and the earlier delivery lease was five minutes,
which is too short to double as one.

Add a twenty minute execution timeout that fails the run with RUN_TIMED_OUT
and a plain reason, and give each research task a one minute deadline to be
accepted so one hung start no longer holds the whole sweep.
A run that failed, timed out, or was cancelled had no way forward except
building a new agent or waiting for the next trigger. A stuck queue looked
identical to a broken agent.

Add agents.retryRun, which queues the run again with the original trigger and
event payload, so retrying an event run replays that event rather than
becoming a manual run. It keeps the same idempotency key and active-run
guards as runNow.

Show Retry on any run that ended without succeeding.
drainAgentRuns dispatched one batch and stopped. Anything left waited for
the next poke, which only arrives on the next CRM event, so a queue could
sit idle with work in it.

Loop until no runs are pending or the pass limit is reached, and log a run
that cannot be dispatched instead of failing the whole sweep.

Make Retry track which run is retrying, so one pending retry no longer
disables the button on every other row.
Retry appeared on a queued run when the viewer could not cancel it, because
visibility was inferred from the cancel permission. The API then refused it
with 'This run has not finished yet'.

Check the run status directly instead.
Every .appended frame carried the whole text accumulated so far, so a long
message was stored once per frame, each copy longer than the last. Storage
grew with the square of message length: 43 runs held 38,617 events and
247.9 MB, of which 35,361 rows and 242.1 MB were frames.

A frame is transport. It exists so a client can paint characters, and the
matching .completed event already holds the final text. Skip any .appended
type on the write path, behind a named predicate with a test, so the rule
covers future stream types instead of one hard-coded name.

Bound the run list to 200 events per run. Rendering a status line must not
load a whole trace.

Historical frames are purged: 3,256 rows and 5.76 MB remain, about 76 events
per run.
… short

Queued work waited for the agent's own schedule. eve dev never fires that
schedule, so a deal event could sit until something else poked, and a
self-hoster saw an agent that silently did nothing.

Poke every minute from the API, which covers dev and adds a backstop in
production. It is skipped entirely when no bridge secret is set, so an
install without one behaves as before.

The run list caps a trace at 200 events. Report the real total and say in
the UI when steps are hidden, rather than showing a short trace as if it
were complete.
Three runnable scripts under test/e2e: Slack delivery to a channel, a direct
message, and a destination Slack refuses; the dispatch chain from a CRM event
to a queued run; and a load test that seeds N events and measures throughput.

The load test seeds its own live agent and removes everything it created, so
it can run against a working database without leaving rows behind.
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

@ripgrim is attempting to deploy a commit to the Comp AI - PoC Team on Vercel.

A member of the Team first needs to authorize it.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 119 files

Tip: instead of fixing issues one by one fix them all with cubic
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Re-trigger cubic

Comment thread packages/auth/src/auth.ts Resolved
Comment thread apps/agent/agent/lib/dispatch.ts Resolved
Comment thread apps/agent/agent/lib/run-runtime.ts Resolved
Comment thread apps/agent/agent/lib/builder-input.ts Resolved
Comment thread AGENTS.md Resolved
Comment thread apps/agent/test/dispatch-health.spec.ts Resolved
Comment thread apps/agent/agent/lib/run-runtime.ts Resolved
Comment thread apps/agent/test/e2e/dispatch.e2e.ts Resolved
Comment thread apps/app/lib/agent-run-failure.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 11 files (changes from recent commits).

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread apps/agent/agent/lib/enrichment.ts Resolved
Comment thread apps/agent/test/e2e/live-run.e2e.ts Resolved
Comment thread apps/agent/test/e2e/retry.e2e.ts Resolved
Comment thread AGENTS.md Resolved
Comment thread AGENTS.md Resolved
Comment thread apps/agent/test/e2e/retry.e2e.ts Resolved
Triggers stayed on the old version, so every queued run used the stale
manifest. A revision now moves them and records the count.
The next number was the current number plus one, which collided with a
higher draft. It now reads the highest number under the agent lock.
The Slack join ran after the commit, so a failed join left a committed
revision that the retry replayed instead of redoing. It runs in the
transaction, on the same connection, so a failure rolls the whole
revision back.
A channel change with no posting action reported success and did nothing.
It is refused.
A database failure on the agent or chat page became a 404. Only a
NOT_FOUND is a 404 now; every other error reaches the error page.
The Slack agent list truncated to 30 rows before it tested for Slack, so
a large workspace saw no Slack agents at all. The test is in the query.
The header said "Slack workspace" for every workspace. It shows the real
team name the install already stores.
A failed clipboard write still toasted success and marked a private
channel as asked. It reports the failure and leaves the dialog open.
Refresh only queued a task, so the channel list never changed. It polls
while the task runs.
Google and Microsoft repeated the same page; both now share one shell.
The retry script called retireAbandoned, which retires every exhausted
task in the table. It flipped unrelated companies to FAILED. The script
now uses its own task kind and holds every other row back while it runs.
The Slack join script joined real channels on every run and never left.
Real joins need E2E_SLACK_JOIN=1, and the three e2e flags are documented.
The load drain pass count is derived from E2E_LOAD_COUNT, so a large run
no longer caps out.
AGENTS.md opened with a stray tag that swallowed its first heading.
A retried run did not appear until the next load. The shared invalidate
helper now includes the history query, so all three paths refresh it.
The sweep removed leftover agents but not the company and deals a killed
run leaves behind. Those rows counted in the next run's totals.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

6 issues found across 81 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/agent/test/e2e/retry.e2e.ts">

<violation number="1" location="apps/agent/test/e2e/retry.e2e.ts:75">
P2: Cleanup in the `finally` is a single `try` block, so if `releaseHeldBack` throws, the subsequent `agentTask.deleteMany` and `company.delete` are skipped and the test's company/tasks leak, while any still-held real rows keep their modified `leasedUntil`. Make each cleanup step independent (e.g. `Promise.allSettled`) so one failure doesn't prevent the others from running.</violation>

<violation number="2" location="apps/agent/test/e2e/retry.e2e.ts:99">
P2: `afterLimit.length === 0` now requires that zero e2e-retry tasks exist at claim time, instead of the previous check that merely excluded the task under test. Any residual `e2e-retry` row left by a prior aborted run (e.g. a hard kill before the finally cleanup) will be claimed and fail this check; consider asserting `!afterLimit.some(row => row.id === task.id)` to keep the test tolerant of leftover siblings.</violation>
</file>

<file name="packages/auth/src/organization.ts">

<violation number="1" location="packages/auth/src/organization.ts:109">
P3: Role normalization now has two independent implementations, so member-list responses and authorization paths can disagree after a future role change. Reuse this exported helper from `WorkspaceService` and remove its local `toRole`.</violation>
</file>

<file name="apps/agent/agent/lib/run-runtime.ts">

<violation number="1" location="apps/agent/agent/lib/run-runtime.ts:741">
P2: A manual run can still complete successfully while reporting `noActionNeeded` when its declared action has already succeeded, even though `stageRunResult` rejects the same result. `finishRun` should reject or fail the run immediately when `noActionNeededRefusal` returns a message instead of falling through to `requiredActionFailure`.</violation>
</file>

<file name="apps/agent/agent/lib/dispatch.ts">

<violation number="1" location="apps/agent/agent/lib/dispatch.ts:169">
P2: A timeout during task claiming can strand claimed research tasks for the full 30-minute lease: the abort guard skips them after `claimDue` has already leased them, but no release or requeue occurs. Releasing aborted claims or continuing to process the returned tasks would keep timed-out sweeps from delaying research work.</violation>
</file>

<file name="apps/app/components/agent-builder/agent-code.tsx">

<violation number="1" location="apps/app/components/agent-builder/agent-code.tsx:167">
P2: Files changed from an empty previous revision cannot display Changes because both new checks treat `previousContent` as a boolean. Checking for `null`/`undefined` rather than truthiness would preserve diffs for valid empty files.</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread apps/agent/agent/lib/deadline.ts Resolved
Comment thread apps/agent/agent/lib/enrichment.ts Resolved
Comment thread apps/agent/agent/lib/builder-input.ts Resolved
Comment thread apps/agent/agent/lib/dispatch.ts Resolved
}
}

export function toWorkspaceRole(value: string): WorkspaceRole {

@cubic-dev-ai cubic-dev-ai Bot Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: Role normalization now has two independent implementations, so member-list responses and authorization paths can disagree after a future role change. Reuse this exported helper from WorkspaceService and remove its local toRole.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/auth/src/organization.ts, line 109:

<comment>Role normalization now has two independent implementations, so member-list responses and authorization paths can disagree after a future role change. Reuse this exported helper from `WorkspaceService` and remove its local `toRole`.</comment>

<file context>
@@ -101,3 +105,18 @@ export async function ensureWorkspaceMembership(
 	}
 }
+
+export function toWorkspaceRole(value: string): WorkspaceRole {
+	return isWorkspaceRole(value) ? value : "member";
+}
</file context>
Fix with cubic

Comment thread apps/agent/test/e2e/load.e2e.ts Resolved
…alled sync

The channel list fetched every workspace member row to read one boolean.
It now reads the sync state from its own query.
A pending people-match task reported "syncing" for 30 seconds and then
went quiet, so a stopped agent looked like a finished sync. The state is
idle, syncing or stalled, and the page says when Slack is not being read.
The channel list loaded every channel and searched in the browser, which
moved the whole list over the wire. The server pages it with a cursor and
searches it, and one hook serves all three call sites.
… version

One poke cancelled a run. A bridge failure left the remote session
running while the API called it cancelled. The heartbeat asks again.
A retry ran the current live version, not the version the failed run
executed, so a redeploy changed what the user retried.
Only the person who connected Slack saw the Slack resource in the
builder. The workspace connection is workspace-wide.
An agent outage returning 502 was reported to the user as a bad request.
A renamed channel queued a second join, because the pending lookup
matched the name while the lock matched the id.
…pace

Two connections to different workspaces could leave the bot account from
one workspace and the user token from another. People sync and private
channel actions then used the wrong workspace. The account and the grant
now commit together under one lock, and a grant for another team goes.
Nothing deleted a stale grant before, so a second workspace that refused
user scopes kept serving the first workspace's token.
Two OAuth hooks could both queue the inventory job. The check and the
create share one lock.
clearSlackUserGrant deleted every workspace's user token when it was
called with no team. It had no caller, so it is gone.
groups:history reads only private channels that added the app, so the
permission screen no longer counts it as workspace-wide.
Two copies of the inventory queue helper become one in @crm/db.
connectionStatus called Slack on every builder load and every save. It
reads the cached channels and queues a background refresh when they are
stale.
A join chose its Slack API path from a cached row that the new columns
default to public and non-member, so a private channel the bot was
already in took the wrong path. The join reads the channel first and
corrects the row.
The health tests slept on real timers. They use the deferred gate the
other dispatch tests use.
The Slack doc called an advisory lock a replacement for a unique row. It
is not: the lock ends at commit and stores nothing.
…s in it

A private channel that needs a human invite stayed selectable, so an
agent could be moved to a channel it cannot post in.
Each row nested a button inside a button. Selection is now a sibling.
A sent message read "Message unavailable" until the refetch, because the
optimistic entry held a string where the reader wanted an object.
A closed save bar kept its buttons in the tab order, so a keyboard user
could trigger a save they cannot see.
The new agent handoff promised the bot joins the channel on creation.
Nothing joins it, so the copy no longer says so.
The cached row no longer chooses the Slack API path, and the builder no
longer waits on Slack. Name replaceSlackConnection, which replaced
pruneOtherSlackAccounts.
@ripgrim
ripgrim force-pushed the rg/chat-send-feedback branch from d60fc31 to b9518aa Compare August 11, 2026 21:16
The overview read "Connected to null" when the workspace granted no user
token, because only the user grant carries the team name. I caused this.
InvalidInput now reports its own name, so a log tells it from an Error.
A whitespace-only prompt passed as a question and parked the builder on a
blank follow-up.
A restart between the Slack token exchange and the account hook lost the
user token, because the install sat in process memory. It sits in
slackInstallation and the account hook consumes it in the same
transaction that picks the surviving account.
Existing channel rows read as public and non-member, because the columns
arrived with a default. classifiedAt records when Slack last said what a
channel is, and an unread row says so instead of claiming the bot can
join it.
agentRun gains cancelRequestedAt and cancelDeliveredAt, and agentTask
gains an indexed subject, for the two fixes that follow.
Prisma generated the migration from the schema.
The save loop deleted a file from the draft after its write returned, so
an edit typed during that write disappeared. It deletes only when the
draft still holds what it sent. I caused this.
A closed save bar kept its height, so one open bar floated above an empty
gap. A closed bar leaves the layout and keeps its exit animation.
The dispatch script seeded before its try block, so a seed failure left a
live agent armed on deal.created in the shared database.
A turn that failed late read an unfinished task as ended now, so it
marked a record that a newer request had just queued as FAILED. An
unfinished task no longer reports an end time, and an open task for the
same record keeps the fallback away.
A delayed question from an earlier turn replaced the question on screen,
so the user's answer was refused. Turn order is the session sequence and
step, which is the whole order; the turn id added nothing.
A failed session write vanished into an empty catch. It retries, then
counts unlinkedSessions so a task under an unrecorded session is visible.
…ommit

A file save left the triggers on the old version, so scheduled and event
runs kept the pre-edit code while a manual run used the new version.
A task queued inside a caller's transaction was poked before that
transaction committed, so the agent looked and found no row. withTasks
pokes once, after the commit.
The SSO permission check reached the global database, so its tests read
past their fixture.
Four task prompts and one dated report described how this branch was
built. They are not rules and nobody reads them again.
docs/slack-reference.md is in no index and nothing links to it. What a
reader needs is in docs/connections.md.
Six conflicts, all two sides adding in one place.
AGENTS.md and packages/db keep both the connections and tracking entries.
packages/auth keeps isSlackConfigured and appUrl, canManageConnections
and canManageTracking.
The dispatch schedule runs sweepBlankFacts beside the drain chain, which
this branch made sequential.
apps/api/.scratch stays deleted.
contactEnrichmentRequested takes upstream's name, contactCreated.
CompanyDirectoryService no longer injects the database, so the tracking
test builds it with the agent alone.
pg is declared, because db:test imports it directly.
@ripgrim ripgrim changed the title Rg/chat send feedback feat: edit a deployed agent, and show what Slack actually granted (CMP-77) Aug 11, 2026
The package declared a test script and had no test files, so bun exited
1 and CI failed. These cover parse's message, InvalidInput's name, and
the prompt that is only whitespace.
companyEnrichmentRequested is companyCreated, matching main and the
tracking tests. The tracking test also stubs withCrmEvents, which this
branch's CompanyDirectoryService now uses to write and emit in one
transaction.
The company and the retired task were written in the same millisecond on
a fast machine, so the record did not read as older than the task and
the sweep left it PENDING. The company is now written a second earlier,
which is what a task with three attempts means.
@ripgrim
ripgrim merged commit 76b443a into trycompai:main Aug 11, 2026
3 of 6 checks passed
strats360 pushed a commit to strats360/crm that referenced this pull request Aug 24, 2026
* Implement currency conversion features and enhance deal handling

- Introduced a new CurrencyModule to manage currency conversion and rates.
- Added ConversionService for handling currency conversions and fetching rates.
- Updated DealsService to support base amounts and currency conversion logic.
- Enhanced Deal and Dashboard functionalities to include reporting currency and unconverted deals.
- Implemented new currency-related contracts and routes for setting reporting currency and manual rates.
- Added integration tests to ensure correct handling of currency conversions and deal totals.

* Refactor currency rates service to use open.er-api.com

- Updated the currency rates service to fetch exchange rates from open.er-api.com, replacing the previous provider frankfurter.dev.
- Enhanced error handling to check for unsupported base currencies in the response.
- Implemented retry logic for fetching rates with a maximum of two attempts and a reduced timeout.
- Cleaned up stale exchange rates for unsupported currencies during the refresh process.
- Updated documentation to reflect the new exchange rate provider and its implications.

* Enhance currency handling and conversion logic

- Introduced baseCurrency to the Deal model to track the currency of baseAmount.
- Updated ConversionService to streamline currency conversion processes and improve deal field handling.
- Enhanced CurrencyService to enforce permissions for managing currency settings based on user roles.
- Refactored DealsService to incorporate base currency logic in deal aggregations and reporting.
- Improved DashboardService to accurately reflect open deal values based on the current reporting currency.
- Updated integration tests to validate new currency handling features and ensure correct behavior across services.

* Enhance currency conversion logic and improve deal handling

- Updated `pendingWhere` method in `ConversionService` to explicitly match null `baseCurrency`, ensuring no deals are excluded from totals.
- Added integration test to verify that deals with missing currency are correctly handled and updated.
- Modified seeding logic to ensure `baseCurrency` is set alongside `baseAmount` for newly created deals, preventing issues with unconverted figures.
- Updated documentation to clarify changes in currency handling and the implications for deal visibility.

* Refine currency conversion logic and enhance deal handling

- Updated `ConversionService` to conditionally clear rates only when `onlyMissing` is false, improving efficiency in handling missing currencies.
- Enhanced integration tests to verify correct behavior when dealing with unconverted figures and missing currency rates.
- Introduced a new utility function in the deal sheet component to manage currency options, ensuring proper display of unsupported currencies.

* Revise agent and API documentation for clarity and structure

- Updated AGENTS.md to emphasize the importance of reviewing relevant documentation before starting work, including a new index table for quick reference.
- Refined API rules in api.md to clarify logging practices and the separation of intelligence from the API.
- Consolidated environment setup instructions into a new setup.md file for better organization and ease of access.
- Enhanced currency handling in DashboardService and related tests to ensure accurate reporting and conversion logic.
- Improved integration tests to validate new currency handling features and ensure correct behavior across services.

* Enhance documentation and introduce new currency handling guidelines

- Updated AGENTS.md to include new references for the Agent panel and local setup instructions.
- Added a new docs/agent-panel.md file detailing the Agent panel's functionality and usage.
- Introduced docs/currency.md to clarify currency handling rules and reporting practices.
- Revised environment setup instructions in docs/environment.md for better clarity and organization.

* Add anonymous usage telemetry documentation and enhance currency handling in DealSheet

* Implement anonymous usage telemetry and enhance related documentation

- Added telemetry functionality to track anonymous usage data, including installation metrics and tool usage.
- Introduced new environment variables for telemetry configuration in `.env.example`.
- Updated `AGENTS.md` to reference the new telemetry documentation.
- Created a `TelemetryModule` with services and controllers for managing telemetry data.
- Added a settings page for telemetry configuration in the application.
- Enhanced error handling and logging for telemetry events across various services.
- Removed outdated ADR on telemetry usage from the repository.

* Remove telemetry-related components and references from the application

- Deleted the TelemetryRouter and its associated service, removing the telemetry status query.
- Updated the settings sidebar to eliminate the Telemetry option.
- Removed the TelemetrySettingsPage and its related components, including the TelemetryStatus display.
- Cleaned up unused imports and references to telemetry throughout the codebase.

* Enhance telemetry functionality and improve budget management

- Added an 'exhausted' state to the focus management to track when the research budget is depleted.
- Updated the spend function to prevent multiple budget exhaustion events from being recorded.
- Refactored the rollup service to handle telemetry rollup claims and restore counters more effectively.
- Improved error handling in telemetry events to ensure proper reporting and recovery from failures.
- Enhanced documentation to clarify the behavior of telemetry when disabled and the implications for data integrity.

* Add telemetry support and enhance landing page analytics

- Introduced `@crm/telemetry` package to manage telemetry configurations and constants.
- Integrated `posthog-js` for analytics on the landing page, ensuring it only runs on allowed domains.
- Updated the `LandingAnalytics` component to initialize analytics tracking based on hostname.
- Enhanced the `audit` hook to exclude specific event types from archiving.
- Improved agent session handling by implementing offline thread management.
- Added utility functions for analytics host validation and created tests for the new functionality.
- Updated documentation to reflect changes in telemetry usage and landing page analytics.

* Update agent panel to use SETTLED_TTL_MS for archive stale time and enhance documentation

- Changed the `staleTime` for the archive query in the agent panel from `Infinity` to `SETTLED_TTL_MS` to ensure proper session management.
- Updated documentation to clarify the behavior of the archive in relation to session state and stale time handling.

* Enhance landing page analytics with CTA event tracking

- Introduced `captureLanding` function to track user interactions with the setup prompt and GitHub star buttons.
- Updated `SetupPromptButton` and `GitHubStarButton` components to accept a `location` prop for distinguishing between 'hero' and 'closing' CTAs.
- Modified `LandingAnalytics` to include new event types for clipboard actions and button clicks.
- Enhanced documentation to reflect the new telemetry events and their usage.

* Update README with new images and remove outdated ones

- Replaced outdated images with new visuals for the landing page, showcasing agents and capabilities.
- Removed references to deleted images related to deals, contacts, and companies to streamline documentation.

* Refactor README to improve layout of screenshots

- Converted individual screenshot sections into a table format for better visual organization.
- Updated captions for clarity and conciseness, enhancing the overall presentation of the landing page visuals.

* Update README and images for landing page

- Removed outdated captions from the README for agents and capabilities images to streamline content.
- Updated binary images for agents, capabilities, and hero sections to enhance visual quality on the landing page.

* Update README and replace landing hero image

- Updated the README to reflect the new image caption for the companies list.
- Replaced the outdated landing hero image with a new product shot to enhance visual appeal.
- Removed the old landing hero image from the repository.

* Update landing page images for agents and capabilities

- Replaced existing binary images for agents and capabilities on the landing page to improve visual quality and consistency.
- Ensured that the new images align with the recent updates to the README and overall landing page design.

* Update landing page images for agents and capabilities to enhance visual quality

* Refactor AddButton component in multiple sheets to use ComponentProps for better type safety

- Updated the AddButton function in create-company-sheet, create-contact-sheet, create-deal-sheet, and add-sso-provider-sheet to accept props of type ComponentProps from the Button component.
- This change enhances type safety and allows for more flexible button properties across different sheets.

* Refactor TelemetryService to integrate RollupService for telemetry rollups

- Replaced FunnelService with RollupService in TelemetryService to handle telemetry rollups.
- Implemented a timer to run rollups hourly, enhancing telemetry data collection.
- Updated documentation to reflect changes in telemetry rollup processes and clarify the in-process execution without cron dependencies.

* Report installs without a cron, and stop double counting them

The install count was reading 1 while 20 databases had migrated. Every
"Active installs" tile is built on install_daily, which only ever fired
from POST /internal/telemetry/rollup — a route that refuses to run
without CRON_SECRET. An install that never configures a cron reported
nothing at all, however much it was used.

TelemetryService now rolls up in-process, on boot and hourly. The
existing row lock on install makes all but the first of those a no-op,
and it short-circuits before the aggregation runs, so it is still one
set of grouped queries per install per day. The route stays, still
behind CRON_SECRET, for a platform cron that would rather drive it;
nothing depends on it now.

Two ways the same event could arrive twice, both of which the hourly
timer would have made more frequent:

A rollup wrongly read as failed hands the day back and is re-sent.
posthog-node does not reject on a failed send, so the client inferred
failure from a module-global error counter that any other capture could
move. It now enqueues and awaits flush(), which does throw, and treats
either signal as a failure — erring toward a re-send, which is free,
over consuming a day whose event never left.

A milestone sent before it was recorded, so both the boot sweep and the
rollup sweep could send the same step. One install sent
first_fact_applied six times. The insert is now the claim: of two
sweeps exactly one is told it landed the row, and only that one sends.
A failed send deletes the row so the step is retried.

Both events also carry a deterministic uuid derived from the install
and the day (or the step), so a duplicate that does get out is ingested
once. Installs and active installs were always safe — PostHog's unique
math is per install per day — but the summed agent-usage properties
were not.

* Derive the dedupe id with SHA-256 in a v8 uuid

CodeQL flags a weak algorithm reached by the install identity, and it
is right that the two do not belong in one expression. SHA-1 was there
only because RFC 4122 defines v5 that way; nothing depends on being a
v5, so this is a SHA-256 digest in a v8 uuid, the slot RFC 9562 leaves
for a derivation of one's own.

* CMP-1 chore: enrich agentic experience

* ci: open pull requests, gate titles and promote releases automatically (trycompai#53)

* Lewis/contact and currencies (trycompai#56)

* Implement fields management features (trycompai#55)

* Lewis/dynamic field fix (trycompai#70)

* Refactor query prefetching in Companies, Contacts, and Deals pages to… (trycompai#71)

* chore: release main (trycompai#72)

* feat(api): add microsoft sign-in and outlook mailbox sync (trycompai#73)

Co-authored-by: Lewis Carhart <[email protected]>

* chore: release release

* ci: run release-please on main and document merge order (trycompai#76)

Co-authored-by: Lewis Carhart <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: release main (trycompai#78)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(db): CMP-1 persist durable custom agents (trycompai#67)

* feat(agent): CMP-1 add sandboxed builder and runner runtimes (trycompai#60)

* refactor(app): CMP-59 harden CRM UI foundations (trycompai#61)

* feat(app): CMP-46 add the private agent builder workspace (trycompai#62)

* feat(app): CMP-12 review agent drafts before deployment (trycompai#63)

* fix(app): CMP-47 consolidate agent builder presentation (trycompai#64)

* feat(app): CMP-47 add inline composer context

* fix(app): move chat beneath overview in icon rail (trycompai#83)

Co-authored-by: grim <[email protected]>

* fix(ci): tag releases automatically and keep previews off the production schema (trycompai#82)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.4.0 (trycompai#86)

* feat(agent): bound agent builder retries and improve chat scrolling (trycompai#89)

* fix(app): render agent transcript chronologically with anchored tool results (trycompai#92)

Co-authored-by: grim <[email protected]>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix(agent): declare granted write actions in draft access summary (trycompai#93)

Co-authored-by: grim <[email protected]>

* chore(main): release 1.5.0 (trycompai#91)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(api): warn when the deployed schema does not match schema.prisma (trycompai#88)

Co-authored-by: Lewis Carhart <[email protected]>

* CMP-62 chore: add gh-stack skill (trycompai#96)

* chore(main): release 1.5.1 (trycompai#97)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(ci): make the release guard reject only genuinely untagged pull requests (trycompai#105)

Co-authored-by: Lewis Carhart <[email protected]>

* fix(ci): stop the auto-titler downgrading a release

The titler regenerated the title on every push once it had written one, so a
pull request's subject was whatever its *last* commits looked like. trycompai#105 carried
the whole website-tracking feature and was retitled `fix(ci)` by its final push,
squashed onto main under that subject, and released as a patch whose notes
mention none of it.

A generated title is now left alone unless it stops being a conventional commit
or stops covering the branch, and no title — generated or typed — may release
less than the commits behind it: `floor_of` takes the strongest bump on the
branch and `generate` raises its proposal to meet it. A branch holding a `feat`
cannot ship as a `fix`, and one holding a breaking change cannot ship without
the `!`. Over-releasing is the safe direction; losing a feature out of the
changelog is not.

* feat(tracking): add website tracking with form capture and attribution

A first-party script on the marketing site, a collector in the API, and one
rule: a form submission becomes a contact. Page views, click labels and
first/last-touch attribution hang off that, with a 90-day retention sweep, an
hourly contact cap and a per-minute event budget.

The work landed in 815a832. The auto-titler had retitled its pull request
`fix(ci)` on the last push, so it squashed onto main under that subject and
released as a patch whose notes describe only the guard fix. This commit carries
no code — it exists so the changelog and the version say what actually shipped.
See docs/tracking.md.

* chore(main): release 1.6.0 (trycompai#106)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(ci): make a release one pull request instead of two

Shipping was a release pull request into `main` and a promotion pull request
into `release`, open at the same time, with a warning on the promotion telling
you to merge the other one first. Merge them the wrong way round and you shipped
untagged code and left the version behind for the next promotion. Nobody should
have to hold that rule in their head to deploy.

The tag and the code have to travel together, so the release workflow now does
it in one step: when release-please cuts the tag it merges that exact commit
into `release` through the merges API. One pull request, no order to remember,
and the tag is by construction an ancestor of what shipped. `promote.yml` is
gone.

A conflict is the one case a human still has to see, and it can only mean
somebody committed to `release` directly, so it fails the run and says so rather
than quietly leaving production behind.

Non-releasable commits now wait for the next release rather than riding a
promotion, which is the trade: `release` moves when a tag is cut and at no other
time.

* fix(ci): fall back to the pushed commit when release-please reports no sha

* chore(main): release 1.6.1 (trycompai#108)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(db): add peek script for inspecting database contents (trycompai#110)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.7.0 (trycompai#111)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(agent): apply sourced facts to empty fields automatically (trycompai#112)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.8.0 (trycompai#113)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(ci): ship releases by opening a pull request into release (trycompai#114)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.8.1 (trycompai#115)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(agent): fill blank fields on the dispatch tick instead of sign-in (trycompai#117)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.8.2 (trycompai#118)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(agent): stop suggesting a URL that already matches the field (trycompai#120)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.9.0 (trycompai#121)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(tracking): support installing the tracking tag via Google Tag Manager (trycompai#124)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.10.0 (trycompai#126)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(app): copy the tracking snippet for the selected install method (trycompai#128)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.11.0 (trycompai#129)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat: edit a deployed agent, and show what Slack actually granted (CMP-77) (trycompai#109)

* chore(main): release 1.12.0 (trycompai#132)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(app): search company dropdowns instead of scrolling them (trycompai#125)

* fix(app): show select field values in record tables (trycompai#133)

* fix(agent): let the assistant chat read the deal list it is told to use (CMP-77) (trycompai#139)

* chore(main): release 1.13.0 (trycompai#136)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: add anti-slop lint rules, dead-code checks and stricter Biome constraints (CMP-80) (trycompai#145)

* refactor: clear anti-slop type assertions and conditional object spreads (CMP-81) (trycompai#146)

* docs: propose an i18n layer (trycompai#143)

* refactor: parse every remaining I/O boundary into a domain type (CMP-82) (trycompai#151)

* fix: unblock the test suite and actually install the git hooks (CMP-83) (trycompai#152)

* ci: run anti-slop lint in CI and pre-push (CMP-84) (trycompai#153)

Co-authored-by: grim <[email protected]>

* feat: enrichment queue widget (CMP-92) (trycompai#159)

* feat(agent): read people from Context.dev instead of RapidAPI (CMP-86) (trycompai#158)

Co-authored-by: grim <[email protected]>

* feat: page the enrichment queue (CMP-92) (trycompai#160)

Co-authored-by: grim <[email protected]>

* chore(main): release 1.14.0 (trycompai#147)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* feat(agent): scope field backfill tasks to records missing values (trycompai#163)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.15.0 (trycompai#164)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(api): serve openapi.json and bundle swagger deps in function build (trycompai#166)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.15.1 (trycompai#167)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Lewis/openapi json (trycompai#169)

* docs(api): explain runtime openapi document and vendoring rules (trycompai#170)

Co-authored-by: Lewis Carhart <[email protected]>

* chore(main): release 1.15.2 (trycompai#171)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(app): prevent url param collision between fields sheet and table filter (trycompai#175)

Co-authored-by: Lewis Carhart <[email protected]>

* fix: stop a finished enrichment reading as failed (trycompai#173)

* chore(main): release 1.15.3 (trycompai#176)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* ci: add Vercel deploy workflow

Deploys to Vercel on push to main/release branches.
Also supports manual trigger via workflow_dispatch with
environment selection (preview/production).

Uses secrets: VERCEL_API_KEY, VERCEL_ORG_ID, VERCEL_PROJECT_ID

---------

Co-authored-by: Lewis Carhart <[email protected]>
Co-authored-by: grim <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Guzman Pintos <[email protected]>
Co-authored-by: twinprime19 <[email protected]>
Co-authored-by: Kiro Agent <[email protected]>
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