Conversation
A new "LinkedIn sync" page lets a person pick the agent signed in to LinkedIn, how often it runs, and turn it on. The app then creates one schedule on that agent through @clawnify/agents; the agent's own scheduler keeps the time, and the app never runs a timer of its own. The procedure the agent follows is skills/linkedin-sync/SKILL.md. A build step snapshots it into the schedule's task text (under the 4,000-character task limit) with its hash, and every save rewrites the text, so a newer skill reaches the agent. - Off until a person turns it on, because every run spends credits. Cadences default to office hours; the fastest is every 10 minutes and says it costs the most. - One run at a time: the agent opens a run first and a partial unique index refuses a second while one is open (409), so an overlapping fire stops at its first call. A run that never reports back stops blocking after 45 minutes. Turning sync off makes the next run stop immediately (410), even if the scheduler cannot be reached. - Schedule creation is idempotent on a stored key, so a retry after a timeout cannot add a second schedule. Moving to another agent removes the old schedule first and stops if that fails; turning it off pauses it; removing it deletes it. - The run routes are in the OpenAPI description for the agent. The settings routes are not, and accept only a signed-in person, so a task never teaches its agent to schedule itself. The page lists recent runs with what each mirrored and sent, or what stopped it.
The every-3-hours option also ran through nights and weekends, which is the pattern LinkedIn reads as automation. The remaining cadences all run on weekdays between 8:00 and 18:00.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #18 (LinkedIn channel). Merge #18 first; this PR then retargets to
main.What
A LinkedIn sync page: pick the agent signed in to LinkedIn, pick how often, and turn it on. The app creates one schedule on that agent through
@clawnify/agents. The agent's own scheduler keeps the time, and the app never runs a timer of its own.Each run follows
skills/linkedin-sync/SKILL.md, which a build step (scripts/build-linkedin-skill.mjs) snapshots into the schedule's task text with its hash:Guarantees
POST /api/linkedin-sync/runsis idempotent on the agent's run id. A partial unique index refuses a second open run (409), so an overlapping fire stops at its first call. A run that never reports back stops blocking after 45 minutes.Checked
pnpm test: 35 pass (including Add LinkedIn as a connections-only channel #18's), 12 new intests/linkedin-sync.test.mjs. They run against the real worker in Miniflare with a fake agents API that records every call.pnpm run typecheckandpnpm run buildpass (both run the skill snapshot first).