OpenProgram Docs

Weekly report workflows

ReportProducesWrites externally
personalThe Feishu personal formFeishu, under its existing gates
personal_chatThe owner's three-section copy for the WeChat groupNever
groupSummary of other members' reports read from WeChatNever
tencentAbout 100 Chinese characters of progress, on Friday afternoonsNever

Package

weekly_report/
  workflow.py             the one public entry, weekly_report(task)
  steps/routing.py        Agent prompt text only
  reports/<report>/       roles, steps and README of each report
  tests/<report>/
openprogram/programs/_authoring/reports/   shared sourcing, output, checkpoint, WeChat modules

Only the root PROGRAM_ENTRIES registers a tool, so Abilities shows one entry. Internal modules are excluded. Discovery allows one category-directory level, rejects symlinks and duplicates, and still needs source authorization. Functions in authorized external directories derive their UI path from their owning directory.

Routing

weekly_report calls an Agent to choose reports from the complete meaning, negation and context, never by keywords or colons. Code validates only the target enum and forwards the request verbatim: no summary, truncation or added draft-only limits.

RequestRunsEach child gets
Write my personal report; Tencent is only a reference, no group reportOnly the personal reportThe full request
Do personal and Tencent, not groupThose twoThe same full request
Do all of themAll, with no shared period or recovery stateThe same full request
Audience unclearpersonal_chat, an unsent discovery draft; never a clarificationThe full request
  • The owner's report for the group is personal_chat. group means collecting other members' reports.
  • One result returns verbatim; several get audience labels. A failed child's section reads as unfinished with its error, and the others still run; only when all fail is the first exception raised. Cancellation stops at once and attaches completed results.
  • No shared week, checkpoint or completion state; each child owns its materials, output and recovery. Old router checkpoints do not resume: pass the child's resume request through requests.
  • JSON {"requests": {"tencent": …}} addresses children directly; result_format: "structured" returns a results mapping without claiming aggregate completion.
  • Each report interprets only its own part. Tencent stores the original in user_request for later model context; materials allow original excerpts only. Group extraction keeps the complete request for source selection.

Source weeks and old drafts

  • The execution week is not necessarily the source week. Memory candidates keep speaker type and source dates. Import time never labels old chat as this week.
  • Trusted original owner records come first; equivalent sources are ordered by date descending within the week.
  • Later factual revisions replace only what conflicts; independent progress stays.
  • Automatic sourcing never reads Workflow checkpoints or a report's sources.json as evidence. Exported sources with citation chains are for audit.
  • Recovery rejects invalidated checkpoints. A wrong week in an old draft keeps its files and audit records, invalidates that execution and retrieves real evidence. Missing material returns a waiting state, not the old draft.

Tencent content

AspectRule
IncludeThis week's actions, findings, results and current problems; methods, subjects and observations from same-week records; literature reviews and reproductions actually performed
ExcludeDirection discussion, meeting agendas, administration, future plans. Cite decisions or findings, not the meeting. No repeated topic lists
Do not inventStates such as completed, validated, improved. Actions without results stay actions. Related external material does not show the user did the work; paper results and personal reproduction are kept apart
FormatAlways starts with the fixed Chinese prefix for “This week's progress:”, then numbered action sentences. No “model not provided” metadata, metaphors or slogans; unrecorded metrics do not mean no data
Enough materialRecorded optimization, submission and validation suffice; model lists and metrics are optional
Ask only whenNo usable action exists, or core facts conflict irreconcilably
Supplementary searchAfter brief progress, up to three topic terms, same-week memory only, merged and deduplicated, then a second selection. At most two selection model calls. Results and budget go in the checkpoint, so recovery does not repeat. Each context at most 30 entries and 18 KB
VerificationIndependent check of source support and reporting scope

WeChat window reading

Binds the unique main window, PID and process-start identity, through GUI Harness MacWindow / window_session. Never opens, activates or raises a window, uses fullscreen screenshots or the clipboard, or delivers process-targeted keyboard or mouse events. Every operation revalidates window and control ownership.

OperationRule
Enter a group nameNative AXSearchField only
Select a groupAXPress on a control matching the exact name and OCR location
PageOnly controls in the message region with accessibility paging; at most twelve pages per attempt, no claim of complete history
ScreenshotScreenCaptureKit desktop-independent window. Nothing persists before the title in the image is verified
MessageNeeds an in-page date and a designated member
Unsupported operationRecoverable state; no switch to foreground
No Accessibility window (screenshot-only binding)SEARCH_UNAVAILABLE; the visual reader reads only the conversation shown, never searches, selects or pages
Header verifies the groupREADY, window_controls unavailable, coverage limited to one visible page
Header does not verifyCAPTURE_ONLY_GROUP_NOT_SHOWN with a reason; nothing persists
A refused background actionBACKGROUND_ACTION_UNAVAILABLE, never treated as applied
Transparent image, missing controls, changed window, concurrent useDistinct reasons and recovery parameters. Never asks the user to raise the window or calls an empty capture missing permission

Temporary screenshots are returned even on cancellation or failed validation. Apple marks NSWindow.SharingType.none legacy; it is not used to infer capture capability.

Agent execution

Session tools, structured output and timeouts
  • New turns restore tool schemas from discovery state on the current branch, intersected with allowed tools. Other sessions and sibling branches do not inherit. Approval recovery uses existing checkpoints and never expands permissions. The ContextVar is released with the turn.
  • A read-only Agent interprets group requests through memory search, directory lookup and file reads to find the group and ordered members. User-provided values win. No sending, writing, Shell, browser or recursive report tools. Unresolved fields stay missing.
  • Structured stages use response_format with prompt fallback: Runtime validates JSON and allows one correction within its request budget and timeout. A format error is a model failure with verbatim retry parameters, not missing user information.
  • Tool turns are governed by max_iterations; a successful tool turn does not consume the failure budget, and normal calls do not replenish it. Every turn checks cancellation and the deadline.
  • Personal fields: a read-only retrieval Agent returns six named fields, validated by JSON Schema. Complete reports need non-empty current-week work and next-week plans; partial edits return only the requested fields. Source verification still decides what structured input is saved. Uncertain external writes are not replayed.
  • Memory search, grep, get and browse are read-only safe tools; they keep memory.read and explicit deny or ask rules.
  • Timeouts: model requests inherit the Runtime deployment timeout (OPENPROGRAM_EXEC_TIMEOUT_S), with no 90-second limit. Later Tencent model stages keep 180 seconds. Browser deadlines and the no-retry rule for uncertain submissions stay.

Implementation status

  • Router, partial completion and recovery are verified in the installed App.
  • Real WeChat message reading is unfinished: calls against the local main window return fully transparent images.
  • Session tool recovery, structured correction and timeout repairs are in verification; earlier acceptance exposed group-model format failures and missing chat invocation, so the full flow is not yet called healthy.
  • Acceptance needs public-entry request-fidelity tests, child context tests, call-graph tests and local App runs through ordinary chat. A direct-function test cannot stand in for a failed chat call, and stage tests cannot replace real source reading or external submission.
Last updated · 2026-11-25